Login   Register  
PHP Classes
elePHPant
Icontem

File: demos/004.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  d3  >  demos/004.php  >  Download  
File: demos/004.php
Role: Example script
Content type: text/plain
Description: treemap example
Class: d3
Output charts using D3.js JavaScript library
Author: By
Last change:
Date: 1 year ago
Size: 865 bytes
 

Contents

Class file image Download
<?php 
include_once "../d3.classes.inc.php";
include_once 
"../wrappers/treemap.php";
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: auto;
  position: relative;
  width: 960px;
}

form {
  position: absolute;
  right: 10px;
  top: 10px;
}

.node {
  border: solid 1px white;
  font: 10px sans-serif;
  line-height: 12px;
  overflow: hidden;
  position: absolute;
  text-indent: 2px;
}

</style>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<form>
  <label><input type="radio" name="mode" value="size" checked> Size</label>
  <label><input type="radio" name="mode" value="count"> Count</label>
</form>
<script>
<?php
$chart 
= new d3TreeMap(array());
echo 
$chart->render();
?>
</script>
</body>
</html>