summaryrefslogtreecommitdiffstats
path: root/docs/tutorial_example_17.php
blob: e7c2d8c6297e35a37e67ee7abda29cfe0010eadc (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
<?php

require_once 'tutorial_autoload.php';

$graph = new ezcGraphLineChart();
$graph->title = 'Some random data';
$graph->legend->position = ezcGraph::BOTTOM;

$graph->xAxis = new ezcGraphChartElementNumericAxis();

$data = array();
for ( $i = 0; $i <= 10; $i++ )
{
    $data[$i] = mt_rand( -5, 5 );
}

// Add data
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );

$average = new ezcGraphDataSetAveragePolynom( $dataset, 3 );
$graph->data[(string) $average->getPolynom()] = $average;

$graph->render( 400, 150, 'tutorial_example_17.svg' );

?>
OpenPOWER on IntegriCloud