simplecharts

SVG charts without dependencies
git clone https://git.ce9e.org/simplecharts.git

commit
fad4a8c5e036bf96e3d93ec9445d968deace83a9
parent
684348fd2cce434ac7118cb9d251ddbe718a84f8
Author
Tobias Bengfort <bengfort@mpib-berlin.mpg.de>
Date
2025-04-24 16:37
test float values

Diffstat

A tests/float.json 9 +++++++++
A tests/float_ColumnRenderer.svg 39 +++++++++++++++++++++++++++++++++++++++
A tests/float_LineRenderer.svg 42 ++++++++++++++++++++++++++++++++++++++++++
A tests/float_StackedAreaRenderer.svg 42 ++++++++++++++++++++++++++++++++++++++++++
A tests/float_StackedColumnRenderer.svg 39 +++++++++++++++++++++++++++++++++++++++

5 files changed, 171 insertions, 0 deletions


diff --git a/tests/float.json b/tests/float.json

@@ -0,0 +1,9 @@
   -1     1 {
   -1     2     "rows": [{
   -1     3         "label": "Apples",
   -1     4         "values": [0.03, 0.02, 0.05]
   -1     5     }, {
   -1     6         "label": "Oranges",
   -1     7         "values": [0.04, 0.02, 0.03]
   -1     8     }]
   -1     9 }

diff --git a/tests/float_ColumnRenderer.svg b/tests/float_ColumnRenderer.svg

@@ -0,0 +1,39 @@
   -1     1 <svg font-family="sans-serif" font-size="16" viewBox="-55 -25 700 530" xmlns="http://www.w3.org/2000/svg">
   -1     2 	<g role="table">
   -1     3 		<line stroke="#333" x1="0" x2="0" y1="0" y2="480" />
   -1     4 		<line stroke="#333" x1="0" x2="640" y1="480" y2="480" />
   -1     5 		<g aria-hidden="true">
   -1     6 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="480">0</text>
   -1     7 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="240.0">0.03</text>
   -1     8 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="0">0.06</text>
   -1     9 		</g>
   -1    10 		<g role="row">
   -1    11 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="160.0" y="490.0">Apples</text>
   -1    12 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="480.0" y="490.0">Oranges</text>
   -1    13 		</g>
   -1    14 		<g fill="#e41a1c" role="row" stroke="white">
   -1    15 			<rect height="239.99999999999997" role="cell" width="64.0" x="64.0" y="239.00000000000003">
   -1    16 				<title>0.03</title>
   -1    17 			</rect>
   -1    18 			<rect height="320.0" role="cell" width="64.0" x="384.0" y="159.0">
   -1    19 				<title>0.04</title>
   -1    20 			</rect>
   -1    21 		</g>
   -1    22 		<g fill="#377eb8" role="row" stroke="white">
   -1    23 			<rect height="160.0" role="cell" width="64.0" x="128.0" y="319.0">
   -1    24 				<title>0.02</title>
   -1    25 			</rect>
   -1    26 			<rect height="160.0" role="cell" width="64.0" x="448.0" y="319.0">
   -1    27 				<title>0.02</title>
   -1    28 			</rect>
   -1    29 		</g>
   -1    30 		<g fill="#4daf4a" role="row" stroke="white">
   -1    31 			<rect height="400.0" role="cell" width="64.0" x="192.0" y="79.0">
   -1    32 				<title>0.05</title>
   -1    33 			</rect>
   -1    34 			<rect height="239.99999999999997" role="cell" width="64.0" x="512.0" y="239.00000000000003">
   -1    35 				<title>0.03</title>
   -1    36 			</rect>
   -1    37 		</g>
   -1    38 	</g>
   -1    39 </svg>

diff --git a/tests/float_LineRenderer.svg b/tests/float_LineRenderer.svg

@@ -0,0 +1,42 @@
   -1     1 <svg font-family="sans-serif" font-size="16" viewBox="-55 -25 700 530" xmlns="http://www.w3.org/2000/svg">
   -1     2 	<g role="table">
   -1     3 		<line stroke="#333" x1="0" x2="0" y1="0" y2="480" />
   -1     4 		<line stroke="#333" x1="0" x2="640" y1="480" y2="480" />
   -1     5 		<g aria-hidden="true">
   -1     6 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="480">0</text>
   -1     7 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="240.0">0.03</text>
   -1     8 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="0">0.06</text>
   -1     9 		</g>
   -1    10 		<g role="row">
   -1    11 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="160.0" y="490.0">Apples</text>
   -1    12 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="480.0" y="490.0">Oranges</text>
   -1    13 		</g>
   -1    14 		<polyline fill="none" points="160,240 480,160" stroke="#e41a1c" />
   -1    15 		<polyline fill="none" points="160,320 480,320" stroke="#377eb8" />
   -1    16 		<polyline fill="none" points="160,80 480,240" stroke="#4daf4a" />
   -1    17 		<g fill="#e41a1c" role="row" stroke="white">
   -1    18 			<circle cx="160.0" cy="240.00000000000003" r="3" role="cell">
   -1    19 				<title>0.03</title>
   -1    20 			</circle>
   -1    21 			<circle cx="480.0" cy="160.0" r="3" role="cell">
   -1    22 				<title>0.04</title>
   -1    23 			</circle>
   -1    24 		</g>
   -1    25 		<g fill="#377eb8" role="row" stroke="white">
   -1    26 			<circle cx="160.0" cy="320.0" r="3" role="cell">
   -1    27 				<title>0.02</title>
   -1    28 			</circle>
   -1    29 			<circle cx="480.0" cy="320.0" r="3" role="cell">
   -1    30 				<title>0.02</title>
   -1    31 			</circle>
   -1    32 		</g>
   -1    33 		<g fill="#4daf4a" role="row" stroke="white">
   -1    34 			<circle cx="160.0" cy="80.0" r="3" role="cell">
   -1    35 				<title>0.05</title>
   -1    36 			</circle>
   -1    37 			<circle cx="480.0" cy="240.00000000000003" r="3" role="cell">
   -1    38 				<title>0.03</title>
   -1    39 			</circle>
   -1    40 		</g>
   -1    41 	</g>
   -1    42 </svg>

diff --git a/tests/float_StackedAreaRenderer.svg b/tests/float_StackedAreaRenderer.svg

@@ -0,0 +1,42 @@
   -1     1 <svg font-family="sans-serif" font-size="16" viewBox="-55 -25 700 530" xmlns="http://www.w3.org/2000/svg">
   -1     2 	<g role="table">
   -1     3 		<line stroke="#333" x1="0" x2="0" y1="0" y2="480" />
   -1     4 		<line stroke="#333" x1="0" x2="640" y1="480" y2="480" />
   -1     5 		<g aria-hidden="true">
   -1     6 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="480">0</text>
   -1     7 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="240.0">0.1</text>
   -1     8 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="0">0.2</text>
   -1     9 		</g>
   -1    10 		<g role="row">
   -1    11 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="160.0" y="490.0">Apples</text>
   -1    12 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="480.0" y="490.0">Oranges</text>
   -1    13 		</g>
   -1    14 		<polyline fill="#e41a1c" points="160,407 480,383 480,479 160,479" stroke="white" />
   -1    15 		<polyline fill="#377eb8" points="160,359 480,335 480,383 160,407" stroke="white" />
   -1    16 		<polyline fill="#4daf4a" points="160,239 480,263 480,335 160,359" stroke="white" />
   -1    17 		<g fill="#e41a1c" role="row" stroke="white">
   -1    18 			<circle cx="160.0" cy="407.0" r="3" role="cell">
   -1    19 				<title>0.03</title>
   -1    20 			</circle>
   -1    21 			<circle cx="480.0" cy="383.0" r="3" role="cell">
   -1    22 				<title>0.04</title>
   -1    23 			</circle>
   -1    24 		</g>
   -1    25 		<g fill="#377eb8" role="row" stroke="white">
   -1    26 			<circle cx="160.0" cy="359.0" r="3" role="cell">
   -1    27 				<title>0.02</title>
   -1    28 			</circle>
   -1    29 			<circle cx="480.0" cy="335.0" r="3" role="cell">
   -1    30 				<title>0.02</title>
   -1    31 			</circle>
   -1    32 		</g>
   -1    33 		<g fill="#4daf4a" role="row" stroke="white">
   -1    34 			<circle cx="160.0" cy="239.00000000000003" r="3" role="cell">
   -1    35 				<title>0.05</title>
   -1    36 			</circle>
   -1    37 			<circle cx="480.0" cy="263.00000000000006" r="3" role="cell">
   -1    38 				<title>0.03</title>
   -1    39 			</circle>
   -1    40 		</g>
   -1    41 	</g>
   -1    42 </svg>

diff --git a/tests/float_StackedColumnRenderer.svg b/tests/float_StackedColumnRenderer.svg

@@ -0,0 +1,39 @@
   -1     1 <svg font-family="sans-serif" font-size="16" viewBox="-55 -25 700 530" xmlns="http://www.w3.org/2000/svg">
   -1     2 	<g role="table">
   -1     3 		<line stroke="#333" x1="0" x2="0" y1="0" y2="480" />
   -1     4 		<line stroke="#333" x1="0" x2="640" y1="480" y2="480" />
   -1     5 		<g aria-hidden="true">
   -1     6 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="480">0</text>
   -1     7 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="240.0">0.1</text>
   -1     8 			<text dominant-baseline="middle" fill="#333" text-anchor="end" x="-4" y="0">0.2</text>
   -1     9 		</g>
   -1    10 		<g role="row">
   -1    11 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="160.0" y="490.0">Apples</text>
   -1    12 			<text dominant-baseline="middle" fill="#333" role="columnheader" text-anchor="middle" x="480.0" y="490.0">Oranges</text>
   -1    13 		</g>
   -1    14 		<g fill="#e41a1c" role="row" stroke="white">
   -1    15 			<rect height="71.99999999999999" role="cell" width="106.66666666666667" x="106.66666666666666" y="407.0">
   -1    16 				<title>0.03</title>
   -1    17 			</rect>
   -1    18 			<rect height="95.99999999999999" role="cell" width="106.66666666666667" x="426.6666666666667" y="383.0">
   -1    19 				<title>0.04</title>
   -1    20 			</rect>
   -1    21 		</g>
   -1    22 		<g fill="#377eb8" role="row" stroke="white">
   -1    23 			<rect height="47.99999999999999" role="cell" width="106.66666666666667" x="106.66666666666666" y="359.0">
   -1    24 				<title>0.02</title>
   -1    25 			</rect>
   -1    26 			<rect height="47.99999999999999" role="cell" width="106.66666666666667" x="426.6666666666667" y="335.0">
   -1    27 				<title>0.02</title>
   -1    28 			</rect>
   -1    29 		</g>
   -1    30 		<g fill="#4daf4a" role="row" stroke="white">
   -1    31 			<rect height="120.0" role="cell" width="106.66666666666667" x="106.66666666666666" y="239.0">
   -1    32 				<title>0.05</title>
   -1    33 			</rect>
   -1    34 			<rect height="71.99999999999999" role="cell" width="106.66666666666667" x="426.6666666666667" y="263.0">
   -1    35 				<title>0.03</title>
   -1    36 			</rect>
   -1    37 		</g>
   -1    38 	</g>
   -1    39 </svg>