mirror of
https://github.com/seigler/neat-charts
synced 2025-07-27 01:16:09 +00:00
added xml tag to img tag charts demo, cleaned up sparkline SVG
This commit is contained in:
parent
b04fc0416f
commit
b5e3ecf479
2 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||
?>
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace NeatCharts {
|
|||
<stop offset="100%" stop-color="'.( $this->options['lineColor'] ).'" stop-opacity="1"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g class="SVGChart">
|
||||
<g class="SVGChart">'.( $this->options['yAxisEnabled'] || $this->options['xAxisEnabled'] ? '
|
||||
<g class="chart__gridLines"
|
||||
shape-rendering="crispEdges"
|
||||
fill="none"
|
||||
|
@ -192,7 +192,7 @@ namespace NeatCharts {
|
|||
font-size="'.( $this->options['fontSize'] ).'px"
|
||||
>
|
||||
'.( $gridText ).'
|
||||
</g>
|
||||
</g>' : '').'
|
||||
<g class="chart__plotLine"
|
||||
fill="none"
|
||||
stroke-width="'.( $this->options['fontSize'] / 3 ).'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue