Esempio n. 1
0
<?php

require '../lib/Chart.php';
require '../lib/markers/ChartTextMarker.php';
$values = array();
for ($i = 0; $i <= 10; $i += 1) {
    $values[] = rand(20, 80);
}
$chart = new Chart('bvs', 500, 200);
$chart->setScale(0, 100);
$data = new ChartData($values);
$chart->addData($data);
$marker = new ChartTextMarker();
$marker->setData($data);
$chart->addMarker($marker);
header('Content-Type: image/png');
echo $chart;
Esempio n. 2
0
$chart = new Chart('lc', 800, 154);
$chart->setAutoscale(Chart::AUTOSCALE_VALUES);
$chart->setGridLines(0, 50, 3, 2);
$chart->setMargin(5);
$values = array(34, 18, 21, 70, 53, 39, 39, 30, 13, 15, 4, 8, 5, 8, 4, 8, 44, 16, 16, 3, 10, 7, 5, 20, 20, 28, 44, null);
$line = new ChartData($values);
$line->setColor('000000');
$line->setThickness(3);
$line->setFill('eeeeee');
$chart->addData($line);
$m = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$m->setData($line);
$m->setColor('000000');
$m->setSize(7);
$m->setBorder(2);
$chart->addMarker($m);
$values = array_fill(0, sizeof($values) - 2, null);
$values[] = 44;
$values[] = 34;
$line2 = new ChartData($values);
$line2->setColor('000000');
$line2->setThickness(3);
$line2->setDash(4, 2);
$line2->setFill('eeeeee');
$chart->addData($line2);
$m = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$m->setData($line2);
$m->setColor('ffffff');
$m->setSize(4);
$m->setBorder(4, '000000');
$m->setPoints(-1);