summaryrefslogtreecommitdiffstats
path: root/docs/tutorial/tutorial_complex_radar_chart.php
blob: e990cf946bf66b49284384882c2752d709d2a71e (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
<?php

require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';

$graph = new ezcGraphRadarChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->options->fillLines = 220;
$graph->legend->position = ezcGraph::BOTTOM;

$graph->rotationAxis = new ezcGraphChartElementNumericAxis();
$graph->rotationAxis->majorStep = 2;
$graph->rotationAxis->minorStep = .5;

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

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

$average = new ezcGraphDataSetAveragePolynom( $dataset, 4 );
$graph->data[(string) $average->getPolynom()] = $average;
$graph->data[(string) $average->getPolynom()]->symbol = ezcGraph::NO_SYMBOL;
$graph->data[(string) $average->getPolynom()]->color = '#9CAE86';

$graph->render( 500, 250, 'tutorial_complex_radar_chart.svg' );

?>
OpenPOWER on IntegriCloud