added xml tag to img tag charts demo, cleaned up sparkline SVG

This commit is contained in:
Joshua Seigler 2016-07-03 02:50:18 -04:00
parent b04fc0416f
commit b5e3ecf479
2 changed files with 5 additions and 3 deletions

View file

@ -12,7 +12,6 @@ for ($n = 0, $current = $offset + 0.5 * $scale; $n < 24; $n++) {
$chartData[$n] = $current;
}
header('Content-type: image/svg+xml; charset=utf-8');
$chart = new NeatCharts\LineChart($chartData, [
'width'=>500,
'height'=>400,
@ -21,5 +20,8 @@ $chart = new NeatCharts\LineChart($chartData, [
'smoothed'=>false,
'fontSize'=>14
]);
header('Content-type: image/svg+xml; charset=utf-8');
echo '<?xml version="1.0" standalone="no"?>' . PHP_EOL;
echo $chart->render();
?>