From b5e3ecf47961e46c17bc9694eb85bfc437e6dae7 Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Sun, 3 Jul 2016 02:50:18 -0400 Subject: [PATCH] added xml tag to img tag charts demo, cleaned up sparkline SVG --- demo-as-image.php | 4 +++- src/NeatCharts/LineChart.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/demo-as-image.php b/demo-as-image.php index 6c200b5..6f4e65e 100644 --- a/demo-as-image.php +++ b/demo-as-image.php @@ -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 '' . PHP_EOL; echo $chart->render(); ?> diff --git a/src/NeatCharts/LineChart.php b/src/NeatCharts/LineChart.php index ec474a1..840c091 100644 --- a/src/NeatCharts/LineChart.php +++ b/src/NeatCharts/LineChart.php @@ -175,7 +175,7 @@ namespace NeatCharts { - + '.( $this->options['yAxisEnabled'] || $this->options['xAxisEnabled'] ? ' '.( $gridText ).' - + ' : '').'