Exemple #1
0
$chart->addData($line2);
$m = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$m->setData($line2);
$m->setColor('ffffff');
$m->setSize(4);
$m->setBorder(4, '000000');
$m->setPoints(-1);
$chart->addMarker($m);
$y_axis = new ChartAxis('y');
$y_axis->setDrawLine(false);
$y_axis->setDrawTickMarks(false);
$y_axis->setLabels(array(null, 35, 70));
$y_axis->setFontSize(9);
$y_axis->setTickMarks(5);
$y_axis->setTickColor('ffffff');
$chart->addAxis($y_axis);
$x_axis = new ChartAxis('x');
$x_axis->setDrawLine(false);
$x_axis->setLabels(array('27 apr', '04 may', '11 may', '18 may'));
$x_axis->setLabelPositions(0, 25.8, 51.8, 77.59999999999999);
$x_axis->setTickMarks(5);
$x_axis->setFontSize(9);
$chart->addAxis($x_axis);
if (isset($_GET['debug'])) {
    var_dump($chart->getQuery());
    echo $chart->validate();
    echo $chart->toHtml();
} else {
    header('Content-Type: image/png');
    echo $chart;
}
$chart->addMarker($marker);
$marker = new ChartTextMarker(ChartTextMarker::VALUE);
$marker->setData($line);
$chart->addMarker($marker);
$line = new ChartData($values[1]);
$line->setDash(2, 2);
$line->setColor('6699cc');
$chart->addData($line);
$line = new ChartData($values[2]);
$line->setLegend('The others');
$line->setColor('ff0000');
$chart->addData($line);
$marker = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$marker->setData($line);
$marker->setColor('ff0000');
$chart->addMarker($marker);
$y_axis = new ChartAxis('y');
$chart->addAxis($y_axis);
$x_axis = new ChartAxis('x');
$x_axis->setTickMarks(5);
$x_axis->setDrawLine(false);
$x_axis->setTickColor('ff0000');
$chart->addAxis($x_axis);
if (isset($_GET['debug'])) {
    var_dump($chart->getQuery());
    echo $chart->validate();
    echo $chart->toHtml();
} else {
    header('Content-Type: image/png');
    echo $chart;
}
$chart->setTitleColor('FFFFFF');
$chart->setTitleSize(18);
$sin = new ChartData($sin);
$sin->setLegend('Sinus');
$sin->setThickness(2);
$sin->setColor('D1F2A5');
$chart->addData($sin);
$cos = new ChartData($cos);
$cos->setLegend('Cosinus');
$cos->setThickness(2);
$cos->setColor('F56991');
$chart->addData($cos);
$y_axis = new ChartAxis('y');
$y_axis->setDrawLine(false);
$y_axis->setRange(-1, 1);
$y_axis->setLabelColor('ffffff');
$chart->addAxis($y_axis);
$x_axis = new ChartAxis('x');
$x_axis->setDrawLine(false);
$x_axis->setRange(0, 360);
$x_axis->setLabels(array(0, 90, 180, 270, 360));
$x_axis->setLabelColor('ffffff');
$chart->addAxis($x_axis);
if (isset($_GET['debug'])) {
    var_dump($chart->getQuery());
    echo $chart->validate();
    echo $chart->toHtml();
} else {
    header('Content-Type: image/png');
    echo $chart;
}