diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 10:15:18 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 10:15:18 +0000 |
commit | 07fb592880d4a394d7e7af2a97f22a84faa18479 (patch) | |
tree | 4ee53ad8f402568e3e0ad6482f206163ac33811c | |
parent | bb58310390495567c0b94a73d96b37cec4ff9157 (diff) | |
download | zetacomponents-graph-07fb592880d4a394d7e7af2a97f22a84faa18479.zip zetacomponents-graph-07fb592880d4a394d7e7af2a97f22a84faa18479.tar.gz |
- Added test case for a bar chart with two sinlge point datasets
-rw-r--r-- | tests/chart_test.php | 19 | ||||
-rw-r--r-- | tests/data/compare/ezcGraphChartTest_testBarChartWithTwoSingleDataPoint.svg | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php index 9b22c55..6484aac 100644 --- a/tests/chart_test.php +++ b/tests/chart_test.php @@ -180,6 +180,25 @@ class ezcGraphChartTest extends ezcGraphTestCase ); } + public function testBarChartWithTwoSingleDataPoint() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $barChart = new ezcGraphBarChart(); + $barChart->data['test'] = new ezcGraphArrayDataSet( + array( 23 ) + ); + $barChart->data['test 2'] = new ezcGraphArrayDataSet( + array( 5 ) + ); + $barChart->render( 400, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + public function testBarChartWithSingleDataPointNumericAxis() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; diff --git a/tests/data/compare/ezcGraphChartTest_testBarChartWithTwoSingleDataPoint.svg b/tests/data/compare/ezcGraphChartTest_testBarChartWithTwoSingleDataPoint.svg new file mode 100644 index 0000000..95a4192 --- /dev/null +++ b/tests/data/compare/ezcGraphChartTest_testBarChartWithTwoSingleDataPoint.svg @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 400.0000,0.0000 L 400.0000,200.0000 L 0.0000,200.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 80.0000,0.0000 L 80.0000,200.0000 L 0.0000,200.0000 z " style="fill: #000000; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M 2.0000,16.0000 L 2.0000,2.0000 L 16.0000,2.0000 L 16.0000,16.0000 L 2.0000,16.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_3"/><path d=" M 2.0000,34.0000 L 2.0000,20.0000 L 16.0000,20.0000 L 16.0000,34.0000 L 2.0000,34.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_5"/><path d=" M 80.0000,180.0000 L 400.0000,180.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_7"/><path d=" M 392.0000,176.0000 L 400.0000,180.0000 L 392.0000,184.0000 L 392.0000,176.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_8"/><path d=" M 112.0000,200.0000 L 112.0000,0.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_9"/><path d=" M 109.5000,5.0000 L 112.0000,0.0000 L 114.5000,5.0000 L 109.5000,5.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_10"/><path d=" M 240.0000,20.0000 L 240.0000,180.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_12"/><path d=" M 240.0000,177.0000 L 240.0000,183.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_13"/><path d=" M 112.0000,166.0000 L 368.0000,166.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_15"/><path d=" M 112.0000,166.6667 L 113.0000,166.6667" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" M 112.0000,154.0000 L 368.0000,154.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_17"/><path d=" M 112.0000,153.3333 L 113.0000,153.3333" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_18"/><path d=" M 112.0000,140.0000 L 368.0000,140.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_19"/><path d=" M 112.0000,140.0000 L 113.0000,140.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_20"/><path d=" M 112.0000,126.0000 L 368.0000,126.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_21"/><path d=" M 112.0000,126.6667 L 115.0000,126.6667" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_22"/><path d=" M 112.0000,114.0000 L 368.0000,114.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_24"/><path d=" M 112.0000,113.3333 L 113.0000,113.3333" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_25"/><path d=" M 112.0000,100.0000 L 368.0000,100.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_26"/><path d=" M 112.0000,100.0000 L 113.0000,100.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" M 112.0000,86.0000 L 368.0000,86.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_28"/><path d=" M 112.0000,86.6667 L 113.0000,86.6667" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_29"/><path d=" M 112.0000,74.0000 L 368.0000,74.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_30"/><path d=" M 112.0000,73.3333 L 115.0000,73.3333" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" M 112.0000,60.0000 L 368.0000,60.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_33"/><path d=" M 112.0000,60.0000 L 113.0000,60.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_34"/><path d=" M 112.0000,46.0000 L 368.0000,46.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><path d=" M 112.0000,46.6667 L 113.0000,46.6667" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_36"/><path d=" M 112.0000,34.0000 L 368.0000,34.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_37"/><path d=" M 112.0000,33.3333 L 113.0000,33.3333" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_38"/><path d=" M 112.0000,20.0000 L 368.0000,20.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><path d=" M 112.0000,20.0000 L 115.0000,20.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" M 172.7937,180.0000 L 121.4938,180.0000 L 121.4938,57.3333 L 172.7937,57.3333 L 172.7937,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_42"/><path d=" M 121.9938,179.5000 L 121.9938,57.8333 L 172.2937,57.8333 L 172.2937,179.5000 L 121.9938,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_43"/><path d=" M 230.5063,180.0000 L 179.2063,180.0000 L 179.2063,153.3333 L 230.5063,153.3333 L 230.5063,180.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_44"/><path d=" M 179.7063,179.5000 L 179.7063,153.8333 L 230.0063,153.8333 L 230.0063,179.5000 L 179.7063,179.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_45"/><g id="ezcGraphTextBox_4"><path d=" M 16.5000,17.0000 L 16.5000,1.5000 L 47.6800,1.5000 L 47.6800,17.0000 L 16.5000,17.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_46"/><text id="ezcGraphTextBox_4_text" x="17.0000" text-length="29.6800px" y="13.9000" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">test</text></g><g id="ezcGraphTextBox_6"><path d=" M 16.5000,35.0000 L 16.5000,19.5000 L 62.5200,19.5000 L 62.5200,35.0000 L 16.5000,35.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_47"/><text id="ezcGraphTextBox_6_text" x="17.0000" text-length="44.5200px" y="31.9000" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">test 2</text></g><g id="ezcGraphTextBox_11"><path d=" M 170.5400,199.0000 L 170.5400,181.5000 L 181.9600,181.5000 L 181.9600,199.0000 L 170.5400,199.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_48"/><text id="ezcGraphTextBox_11_text" x="171.0400" text-length="9.9200px" y="195.6000" style="font-size: 16px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">0</text></g><g id="ezcGraphTextBox_14"><path d=" M 99.5800,179.0000 L 99.5800,161.5000 L 111.0000,161.5000 L 111.0000,179.0000 L 99.5800,179.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_49"/><text id="ezcGraphTextBox_14_text" x="100.0800" text-length="9.9200px" y="175.6000" style="font-size: 16px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">0</text></g><g id="ezcGraphTextBox_23"><path d=" M 89.6600,125.6667 L 89.6600,108.1667 L 111.0000,108.1667 L 111.0000,125.6667 L 89.6600,125.6667 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_50"/><text id="ezcGraphTextBox_23_text" x="90.1600" text-length="19.8400px" y="122.2667" style="font-size: 16px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">10</text></g><g id="ezcGraphTextBox_32"><path d=" M 89.6600,72.3333 L 89.6600,54.8333 L 111.0000,54.8333 L 111.0000,72.3333 L 89.6600,72.3333 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_51"/><text id="ezcGraphTextBox_32_text" x="90.1600" text-length="19.8400px" y="68.9333" style="font-size: 16px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">20</text></g><g id="ezcGraphTextBox_41"><path d=" M 89.6600,39.0000 L 89.6600,21.5000 L 111.0000,21.5000 L 111.0000,39.0000 L 89.6600,39.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_52"/><text id="ezcGraphTextBox_41_text" x="90.1600" text-length="19.8400px" y="35.6000" style="font-size: 16px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">30</text></g></g></svg> |