<?php require_once 'tutorial_autoload.php'; require_once 'tutorial_custom_palette_palette.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->palette = new tutorialCustomPalette(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['German']->displayType = ezcGraph::LINE; $graph->options->fillLines = 210; $graph->render(400, 150, 'tutorial_custom_palette.svg');
<?php require_once 'tutorial_autoload.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['German']->displayType = ezcGraph::LINE; $graph->data['German']->highlight = true; $graph->data['German']->highlight['Mar 2006'] = false; $graph->options->fillLines = 210; $graph->options->highlightSize = 12; $graph->options->highlightFont->background = '#EEEEEC88'; $graph->options->highlightFont->border = '#000000'; $graph->options->highlightFont->borderWidth = 1; // $graph->renderer = new ezcGraphRenderer2d(); $graph->renderer->options->barMargin = 0.2; $graph->renderer->options->barPadding = 0.2; $graph->renderer->options->dataBorder = 0; $graph->render(400, 150, 'tutorial_bar_chart_options.svg');
<?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 = 0.5; $graph->renderer->options->legendSymbolGleam = 0.5; $graph->driver = new ezcGraphSvgDriver(); // Output the graph with std SVG driver $graph->render(500, 200, 'forum_evolution.svg');
public function testReturnFrom3dSvgBarChart() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); $chart->renderer = new ezcGraphRenderer3d(); $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['moreData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['evenMoreData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['sampleData']->url = 'http://example.com/sampleData'; $chart->data['sampleData']->symbol = ezcGraph::DIAMOND; $chart->data['moreData']->url = 'http://example.com/moreData'; $chart->data['moreData']->symbol = ezcGraph::CIRCLE; $chart->data['evenMoreData']->url = 'http://example.com/evenMoreData'; $chart->data['evenMoreData']->symbol = ezcGraph::BULLET; $chart->render(500, 200, $filename); $reference = $chart->renderer->getElementReferences(); // Check data references $this->assertSame(3, count($reference['data']), '3 datasets expected.'); $this->assertSame(5, count($reference['data']['sampleData']), '[sampleData] 5 datapoints expected.'); $this->assertSame(3, count($reference['data']['sampleData']['sample 2']), '[sampleData] 3 elements for datapoint expected.'); $this->assertSame('ezcGraphPolygon_98', $reference['data']['sampleData']['sample 2'][0], '[sampleData] ezcGraph element expected.'); $this->assertSame('ezcGraphPolygon_99', $reference['data']['sampleData']['sample 2'][1], '[sampleData] ezcGraph element expected.'); $this->assertSame('ezcGraphPolygon_100', $reference['data']['sampleData']['sample 2'][2], '[sampleData] ezcGraph element expected.'); // Check data references $this->assertSame(5, count($reference['data']['moreData']), '[moreData] 5 datapoints expected.'); $this->assertSame(2, count($reference['data']['moreData']['sample 2']), '[moreData] 3 elements for datapoint expected.'); $this->assertSame('ezcGraphCircularArc_102', $reference['data']['moreData']['sample 2'][0], '[moreData] ezcGraph element expected.'); $this->assertSame('ezcGraphCircle_103', $reference['data']['moreData']['sample 2'][1], '[moreData] ezcGraph element expected.'); // Check data references $this->assertSame(5, count($reference['data']['evenMoreData']), '[evenMoreData] 5 datapoints expected.'); $this->assertSame(2, count($reference['data']['evenMoreData']['sample 2']), '[evenMoreData] 3 elements for datapoint expected.'); $this->assertSame('ezcGraphCircularArc_105', $reference['data']['evenMoreData']['sample 2'][0], '[evenMoreData] ezcGraph element expected.'); $this->assertSame('ezcGraphCircle_106', $reference['data']['evenMoreData']['sample 2'][1], '[evenMoreData] ezcGraph element expected.'); // Check legend references $this->assertSame(3, count($reference['legend']), '3 legend items expected.'); $this->assertSame(2, count($reference['legend']['sampleData']), '2 elements for legend item expected.'); $this->assertSame('ezcGraphPolygon_4', $reference['legend']['sampleData']['symbol'], 'ezcGraphCircle expected as legend symbol.'); $this->assertSame('ezcGraphTextBox_5', $reference['legend']['sampleData']['text'], 'ezcGraphTextBox expected for legend text.'); // Check legend references $this->assertSame(3, count($reference['legend']), '3 legend items expected.'); $this->assertSame(2, count($reference['legend']['moreData']), '2 elements for legend item expected.'); $this->assertSame('ezcGraphCircle_6', $reference['legend']['moreData']['symbol'], 'ezcGraphCircle expected as legend symbol.'); $this->assertSame('ezcGraphTextBox_7', $reference['legend']['moreData']['text'], 'ezcGraphTextBox expected for legend text.'); // Check legend references $this->assertSame(3, count($reference['legend']), '3 legend items expected.'); $this->assertSame(2, count($reference['legend']['evenMoreData']), '2 elements for legend item expected.'); $this->assertSame('ezcGraphCircle_8', $reference['legend']['evenMoreData']['symbol'], 'ezcGraphCircle expected as legend symbol.'); $this->assertSame('ezcGraphTextBox_9', $reference['legend']['evenMoreData']['text'], 'ezcGraphTextBox expected for legend text.'); // Check for legend URLs $this->assertSame(3, count($reference['legend_url']), '3 legend url items expected.'); $this->assertSame('http://example.com/moreData', $reference['legend_url']['moreData'], 'Link expected for "moreData".'); $this->assertSame('http://example.com/sampleData', $reference['legend_url']['sampleData'], 'Link expected for "sampleData".'); }
public function test3dBarChartSvgLinking() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); $chart->options->fillLines = 200; $chart->renderer = new ezcGraphRenderer3d(); $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['moreData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['evenMoreData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1)); $chart->data['sampleData']->url = 'http://example.com/sampleData'; $chart->data['sampleData']->symbol = ezcGraph::DIAMOND; $chart->data['moreData']->url = 'http://example.com/moreData'; $chart->data['moreData']->symbol = ezcGraph::CIRCLE; $chart->data['evenMoreData']->url = 'http://example.com/evenMoreData'; $chart->data['evenMoreData']->symbol = ezcGraph::BULLET; $chart->render(500, 200, $filename); ezcGraphTools::linkSvgElements($chart); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
<?php require_once 'tutorial_autoload.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->palette = new ezcGraphPaletteEz(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['English']->symbol = ezcGraph::NO_SYMBOL; $graph->data['German']->symbol = ezcGraph::BULLET; $graph->data['Norwegian']->symbol = ezcGraph::DIAMOND; $graph->renderer = new ezcGraphRenderer3d(); $graph->renderer->options->legendSymbolGleam = 0.5; $graph->renderer->options->barChartGleam = 0.5; $graph->render(400, 150, 'tutorial_bar_chart_3d.svg');
/** * create graph via ezc/gd2 * @todo verify availability of gd2? * @todo improve layout: col. width, x axis labels, etc... * @todo if zetacomponent graph is not there, create an error image using gd */ static function graph($data, $dataname, $scale = 60) { $content = false; self::$lastError = ''; $times = array_keys($data); $min = $times[0]; $max = end($times); if (!class_exists('ezcGraphBarChart')) { $errormsg = "Error while rendering graph: missing Zetacomponents Graph library"; self::$lastError = $errormsg; eZDebug::writeError($errormsg); return false; } $graph = new ezcGraphBarChart(); $locale = eZLocale::instance(); $graph->title = "From " . $locale->formatShortDateTime($min) . " to " . $locale->formatShortDateTime($max); //$graph->xAxis->label = "From " . $locale->formatShortDateTime( $min ) . " to " . $locale->formatShortDateTime( $max ); $graph->options->font->maxFontSize = 10; $graph->palette = new ezcGraphPaletteEzBlue(); $graph->yAxis->label = $dataname; $graph->yAxis->min = 0; $graph->legend = false; // width of bar charts is not calculated correctly by DateAxis //$graph->xAxis = new ezcGraphChartElementDateAxis(); //$graph->xAxis->interval = $scale; $graph->xAxis = new ezcGraphChartElementNumericAxis(); $graph->xAxis->min = $min - $scale / 2; $graph->xAxis->max = $max + $scale / 2; $graph->xAxis->labelCallback = 'calcChurnLabel'; $graph->data[$dataname] = new ezcGraphArrayDataSet($data); $graph->driver = new ezcGraphGdDriver2(); $graph->driver->options->imageFormat = IMG_JPEG; // pick a font that is delivered along with ezp $graph->options->font = 'design/standard/fonts/arial.ttf'; try { $ok = ob_start(); $graph->render(600, 400, 'php://stdout'); $content = ob_get_clean(); //$clusterfile->fileStoreContents( $cachefile, $content ); } catch (exception $e) { $errormsg = "Error while rendering graph: " . $e->getMessage(); self::$lastError = $errormsg; eZDebug::writeError($errormsg); } return $content; }
<?php require_once 'tutorial_autoload.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->palette = new ezcGraphPaletteBlack(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['German']->displayType = ezcGraph::LINE; $graph->options->fillLines = 210; $graph->render(400, 150, 'tutorial_user_palette.svg');
<?php require_once 'tutorial_autoload.php'; require_once 'tutorial_custom_palette.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->palette = new tutorialCustomPalette(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['German']->displayType = ezcGraph::LINE; $graph->options->fillLines = 210; $graph->render(400, 150, 'tutorial_modified_palette.svg');
<?php require_once '../tutorial_autoload.php'; $wikidata = (include '../tutorial_wikipedia_data.php'); // Create a bar chart $graph = new ezcGraphBarChart(); $graph->data['German articles'] = new ezcGraphArrayDataSet($wikidata['German']); $graph->render(400, 150, 'example_02.svg');
<?php require_once 'tutorial_autoload.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->title = 'Wikipedia articles'; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->data['German']->displayType = ezcGraph::LINE; $graph->options->fillLines = 210; $graph->render(400, 150, 'tutorial_bar_line_chart.svg');
public function testRenderWithZeroAxisSpace() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $labelCount = 20; $data = $this->getRandomData($labelCount, 500, 2000, 23); $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); $chart->data['sample'] = new ezcGraphArrayDataSet($data); // Set manual label count $chart->xAxis->labelCount = 21; $chart->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedBoxedLabelRenderer(); $chart->xAxis->axisLabelRenderer->angle = 45; $chart->xAxis->axisSpace = 0.1; $chart->yAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer(); $chart->yAxis->axisSpace = 0; $chart->render(500, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
protected function generateCharts(InputInterface $input, OutputInterface $output, $destination, array $results) { $gd_info = gd_info(); if (!$gd_info['FreeType Support']) { throw new \RuntimeException('gd extension must be compiled with FreeType support'); } $font = $this->getChartFont($input); list($width, $height) = $this->getChartDimensions($input); $chart_data = $this->getChartData($results); foreach ($chart_data as $measure => $benchmarks) { foreach ($benchmarks as $benchmark => $subbenchmarks) { $file = $destination . '/' . $benchmark . '_' . $measure . '.png'; $output->writeln('<comment>Writing ' . $file . '</comment>'); $driver = new \ezcGraphGdDriver(); $driver->options->supersampling = 1; $driver->options->imageFormat = IMG_PNG; $graph = new \ezcGraphBarChart(); $graph->driver = $driver; $graph->options->font = $font; $graph->xAxis->label = 'Elements'; $graph->yAxis->label = $measure == 'memory' ? 'Memory (KB)' : 'Executions / Second'; $graph->title = $benchmark . ' - ' . $measure; foreach ($subbenchmarks as $subbenchmark => $elements) { $graph->data[$subbenchmark] = new \ezcGraphArrayDataSet($elements); } $graph->render($width, $height, $file); } } }
public function testBarChartWithSingleDataPointNumericAxis() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $barChart = new ezcGraphBarChart(); $barChart->xAxis = new ezcGraphChartElementNumericAxis(); $barChart->data['test'] = new ezcGraphArrayDataSet(array(23)); $barChart->render(400, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
/** * Build Networth Graphic for balance sheet * @param array $financialData */ public function buildNetWorthGraphic($netWorthData) { $graphic = 'nw' . time() . '.png'; $nwGraphicFile = APPLICATION_PATH . '/../pdf/images/' . $graphic; $graph = new ezcGraphBarChart(); $graph->palette = new ezcGraphPaletteEzBlue(); $graph->title = 'Net Worth'; $graph->legend = false; $graph->driver = new ezcGraphGdDriver(); $graph->options->font = APPLICATION_PATH . '/../pdf/fonts/font.ttf'; $graph->driver->options->imageFormat = IMG_PNG; $graph->data['Net Worth'] = new ezcGraphArrayDataSet(array('Today' => str_replace(',', '', $netWorthData['net_worth']), 'Future' => str_replace(',', '', $netWorthData['net_worth_f']), 'FFR Plan A' => str_replace(',', '', $netWorthData['net_worth_a']), 'FFR Plan B' => str_replace(',', '', $netWorthData['net_worth_b']), 'FFR Plan C' => str_replace(',', '', $netWorthData['net_worth_c']))); $graph->render(400, 200, $nwGraphicFile); $netWorthGraphic = array('nwGraphicFile' => $nwGraphicFile, 'graphic' => $graphic); return $netWorthGraphic; }
public function testRenderBarChartWithHighlightedData() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->palette = new ezcGraphPaletteBlack(); $chart->data['Line 1'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => -21, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1)); $chart->data['Line 2'] = new ezcGraphArrayDataSet(array('sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613)); $chart->data['Line 1']->highlight = true; $chart->data['Line 2']->highlight['sample 5'] = true; $chart->data['Line 1']->displayType = ezcGraph::BAR; $chart->options->highlightSize = 12; $chart->options->highlightFont->color = ezcGraphColor::fromHex('#3465A4'); $chart->options->highlightFont->background = ezcGraphColor::fromHex('#D3D7CF'); $chart->options->highlightFont->border = ezcGraphColor::fromHex('#888A85'); $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); $chart->render(500, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
public function testStackedBarChart3d() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->options->stackBars = true; $chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987)); $chart->data['sample 2'] = new ezcGraphArrayDataSet(array('Mozilla' => 4352, 'IE' => 745, 'Opera' => 204, 'wget' => 2231, 'Safari' => 487)); $chart->data['sample 3'] = new ezcGraphArrayDataSet(array('Mozilla' => 234, 'IE' => 100, 'Opera' => 0, 'wget' => -934, 'Safari' => 2043)); $chart->renderer = new ezcGraphRenderer3d(); $chart->render(500, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
public function testStackedBarChartBug13253() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $graph = new ezcGraphBarChart(); $graph->data['values'] = new ezcGraphArrayDataSet(array('string 1' => 55, 'string 2' => 25, 'string 3' => 10, 'string 4' => 10, 'string 5' => 5)); $graph->data['remains'] = new ezcGraphArrayDataSet(array('string 1' => 45, 'string 2' => 75, 'string 3' => 90, 'string 4' => 90, 'string 5' => 95)); $graph->palette = new ezcGraphPaletteEzRed(); $graph->options->stackBars = true; $graph->render(500, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
<?php require_once 'tutorial_autoload.php'; $wikidata = (include 'tutorial_wikipedia_data.php'); $graph = new ezcGraphBarChart(); $graph->title = 'Wikipedia articles'; // Stack bars $graph->options->stackBars = true; // Add data foreach ($wikidata as $language => $data) { $graph->data[$language] = new ezcGraphArrayDataSet($data); } $graph->yAxis->label = 'Thousand articles'; $graph->render(400, 150, 'tutorial_stacked_bar_chart.svg');
public function testRenderBarChartWithUnregularStepSizes() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->legend = false; $chart->data['dataset'] = new ezcGraphArrayDataSet(array(12, 43, 324, 12, 43, 125, 120, 123, 543, 12, 45, 76, 87, 99)); $chart->data['dataset']->color = '#3465A47F'; $chart->renderer = new ezcGraphRenderer3d(); try { $chart->render(500, 200, $filename); } catch (ezcGraphUnregularStepsException $e) { return true; } $this->fail('Expected ezcGraphUnregularStepsException.'); }
$header = $header . "</tr> </thead>"; $i = 0; foreach ($user_info as $g => $vals) { for ($j = 0; $j < count($sz_range_fields); $j++) { $tab[$i][] = $vals[$sz_range_fields[$j]]; if (isset($sz_ranges[$sz_range_name[$j]])) { $sz_ranges[$sz_range_name[$j]] += $vals[$sz_range_fields[$j]]; } else { $sz_ranges[$sz_range_name[$j]] = $vals[$sz_range_fields[$j]]; } } $i++; } echo '<h2 style="line-height:1;">File count per size range</h2>'; generateMergedTable($tab, $header); // build profile chart $graph = new ezcGraphBarChart(); $graph->palette = new ezcGraphPaletteEzBlue(); $graph->legend = false; $graph->data['File size profile'] = new ezcGraphArrayDataSet($sz_ranges); $graph->xAxis->label = 'Size range'; $graph->yAxis->label = 'File count'; $graph->driver = new ezcGraphGdDriver(); $graph->options->font = 'app/img/KhmerOSclassic.ttf'; $graph->driver->options->imageFormat = IMG_PNG; $graph->render(532, 300, 'app/img/graph/sizeCountBarGraph-' . $user . '.png'); echo '<br><img src="app/img/graph/sizeCountBarGraph-' . $user . '.png" />'; echo '<br><i>Size repartition for user ' . $user . '</i>'; ?>
public function testRenderBarChartWithMoreBarsThenMajorSteps() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $chart = new ezcGraphBarChart(); $chart->legend = false; $chart->xAxis = new ezcGraphChartElementNumericAxis(); $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); $chart->data['dataset'] = new ezcGraphArrayDataSet(array(12, 43, 324, 12, 43, 125, 120, 123, 543, 12, 45, 76, 87, 99, 834, 34, 453)); $chart->data['dataset']->color = '#3465A47F'; $chart->render(500, 200, $filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }
//$graph->data[ $matchesPerMonth['timestamp'] ] = new ezcGraphArrayDataSet( array($matchesPerMonth['timestamp'] => $matchesPerMonth['matches']) ); $graph->data[$matchesPerMonth['timestamp']] = new ezcGraphArrayDataSet($dataset); //} echo '<pre>'; print_r($dataset); echo '</pre>'; $graph->data[$matchesPerMonth['timestamp']]->displayType = ezcGraph::LINE; $graph->data[$matchesPerMonth['timestamp']]->highlight = true; $graph->data[$matchesPerMonth['timestamp']]->highlightSize = 3; //print_r($matchesPerMonth); //$graph->data[ '1' ] = new ezcGraphArrayDataSet( array('M' => 3) ); //$graph->data[ '2' ] = new ezcGraphArrayDataSet( array('W' => 6) ); //$graph->options->label = '%3$.1f%%'; //$graph->options->sum = 100; //$graph->options->percentThreshold = 0.02; //$graph->options->summarizeCaption = 'Others'; // $graph->renderer = new ezcGraphRenderer3d(); $graph->render(1450, 450, 'img/ersterversuch.png'); /* $chart = new PieChart(450,250); $dataSet = new XYDataSet(); $chart->getPlot()->setGraphPadding(new Padding(0, 15, 15, 50)); // add a data point for each month foreach ($matches AS $matchesPerYear) { $dataSet->addPoint(new Point($matchesPerYear['year'], $matchesPerYear['matches'])); } $chart->setDataSet($dataSet); $chart->setTitle("Official GU Matches [ 2005 - 2010 ]"); $chart->render("img/demo2.png"); */