fehlerhafte-achsenbeschriftung.php (1.1 kb) added by Kore Nordmann
<?php
function __autoload($sClassName)
{
ezcBase::autoload($sClassName);
}
require_once 'ezcomponents/Base/src/base.php';
$aData = array(
'Merkmal1' => array(
'Material1' => 10,
'Material2' => 11.1,
'Material3' => 11.1,
'Material4' => 9.7,
'Material5' => 12.3,
'Material6' => 6.4,
'Material7' => 5.8,
'Material8' => 5.4
)
);
$oGraph = new ezcGraphBarChart();
$oGraph->driver = new ezcGraphGdDriver();
$oGraph->options->font = 'tutorial_font.ttf';
$oGraph->legend = false;
$aValues = array();
foreach ($aData as $sMerkmal => $aMaterial)
{
$oGraph->data[$sMerkmal] = new ezcGraphArrayDataSet($aMaterial);
$oGraph->data[$sMerkmal]->highlight = true;
foreach ($aMaterial as $mValues)
{
$aValues[] = $mValues;
}
}
//$oGraph->yAxis = new ezcGraphChartElementNumericAxis();
$oGraph->yAxis->label = 'Einheit';
$oGraph->yAxis->min = min(min($aValues) * 1.1, 0);
$oGraph->yAxis->max = max(max($aValues) * 1.1, 0);
$oGraph->renderer->options->barMargin = .3;
$oGraph->render(min(800, count($aValues) * 400), 350, 'diagram.jpg');
?>