blob: b0ca783af4d69055c495ea1b60e138a8bd343efa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Require custom palette
require dirname( __FILE__ ) . '/ez_red.php';
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->legend = false;
// Add the data and hilight norwegian data set
$graph->data['week'] = new ezcGraphArrayDataSet( array(
'Claudia Kosny' => 128,
'Kristof Coomans' => 70,
'Xavier Dutoit' => 64,
'David Jones' => 58,
'Lukasz Serwatka' => 45,
'Norman Leutner' => 22,
'Marko Zmak' => 20,
'sangib das' => 20,
'Nabil Alimi' => 19,
) );
// Set graph title
$graph->title = '10 most active users on forum in last month';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->pieChartOffset = 100;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_month.svg' );
?>
|