summaryrefslogtreecommitdiffstats
path: root/docs/examples/forum_evolution.php
blob: 94f2d9b941b982e926c61e32a650b9def86fd848 (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
48
<?php

require 'Base/src/base.php';
function __autoload( $className )
{
        ezcBase::autoload( $className );
}

// Create the graph
$graph = new ezcGraphBarChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->xAxis->majorGrid = '#888888';
$graph->yAxis->majorGrid = '#888888';

// Add the data and hilight norwegian data set
$graph->data['Posts'] = new ezcGraphArrayDataSet( array(
    'May 2006' => 1164,
    'Jun 2006' => 965,
    'Jul 2006' => 1014,
    'Aug 2006' => 1269,
    'Sep 2006' => 1269,
    'Oct 2006' => 771,
) );

$graph->data['per day'] = new ezcGraphArrayDataSet( array(
    'May 2006' => 38,
    'Jun 2006' => 32,
    'Jul 2006' => 33,
    'Aug 2006' => 41,
    'Sep 2006' => 34,
    'Oct 2006' => 25,
) );

// Set graph title
$graph->title = 'Forum posts in last months';

// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();

$graph->renderer->options->barChartGleam = .5;
$graph->renderer->options->legendSymbolGleam = .5;

$graph->driver = new ezcGraphSvgDriver();

// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_evolution.svg' );

?>
OpenPOWER on IntegriCloud