コード例 #1
0
 public function testLogarithmicalRotationAxis()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphRadarChart();
     $chart->palette = new ezcGraphPaletteEzBlue();
     $chart->legend = false;
     $chart->data['sample'] = new ezcGraphArrayDataSet(array(1 => 12, 5 => 7, 10 => 234, 132 => 34, 1125 => 12, 12346 => 6, 140596 => 1));
     $chart->rotationAxis = new ezcGraphChartElementLogarithmicalAxis();
     $chart->render(400, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
コード例 #2
0
 public function testRenderTextBoxes()
 {
     $chart = new ezcGraphRadarChart();
     $chart->palette = new ezcGraphPaletteBlack();
     $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1));
     $mockedRenderer = $this->getMock('ezcGraphRenderer2d', array('drawText'));
     $mockedRenderer->expects($this->at(0))->method('drawText')->with($this->equalTo(new ezcGraphBoundings(142.0, 182.0, 202.0, 198.0), 1.0), $this->equalTo('sample 1'), $this->equalTo(ezcGraph::TOP | ezcGraph::CENTER));
     $mockedRenderer->expects($this->at(4))->method('drawText')->with($this->equalTo(new ezcGraphBoundings(398.0, 182.0, 458.0, 198.0), 1.0), $this->equalTo('sample 5'), $this->equalTo(ezcGraph::TOP | ezcGraph::CENTER));
     $chart->renderer = $mockedRenderer;
     $chart->render(500, 200);
 }
コード例 #3
0
<?php

require_once 'tutorial_autoload.php';
$wikidata = (include 'tutorial_wikipedia_data.php');
$graph = new ezcGraphRadarChart();
$graph->title = 'Wikipedia articles';
$graph->options->fillLines = 220;
// Add data
foreach ($wikidata as $language => $data) {
    $graph->data[$language] = new ezcGraphArrayDataSet($data);
    $graph->data[$language][] = reset($data);
}
$graph->render(400, 150, 'tutorial_radar_chart.svg');
コード例 #4
0
ファイル: radar_chart.php プロジェクト: mediasadc/alba
 public function testRadarLogarithmicalAxis()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphRadarChart();
     $chart->palette = new ezcGraphPaletteBlack();
     $chart->axis = new ezcGraphChartElementLogarithmicalAxis();
     $chart->options->fillLines = 210;
     $chart->data['sample 1'] = new ezcGraphArrayDataSet($this->getRandomData(8, 1, 1000000));
     $chart->data['sample 2'] = new ezcGraphArrayDataSet($this->getRandomData(8, 1, 1000000, 42));
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
コード例 #5
0
<?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 = 0.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');