summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2008-07-02 22:34:42 +0000
committerKore Nordmann <github@kore-nordmann.de>2008-07-02 22:34:42 +0000
commit663755b520265cb1cc4bc3edf30370f54f16c86e (patch)
tree551a8ac31edace3c3b5c0e8cc5a5fa658811d239
parentf4665de0edcca47b6fa59ebda67cb0ea61dd2545 (diff)
downloadzetacomponents-graph-663755b520265cb1cc4bc3edf30370f54f16c86e.zip
zetacomponents-graph-663755b520265cb1cc4bc3edf30370f54f16c86e.tar.gz
- Fixed issue #13253: Division by zero when trying to render stacked bars.
-rw-r--r--ChangeLog2
-rw-r--r--src/charts/line.php3
-rw-r--r--tests/data/compare/ezcGraphLineChartTest_testStackedBarChartBug13253.svg2
-rw-r--r--tests/line_test.php31
4 files changed, 36 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9abcc0c..8061ba1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,7 +5,7 @@
- Implemented feature #13102: Axes not extending beyond zero in line charts
- Implemented feature #11981: Provide option for exact axis label renderer to
put last value outside of the normal label boundings
-
+- Fixed issue #13253: Division by zero when trying to render stacked bars.
1.3 - Monday 16 June 2008
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/charts/line.php b/src/charts/line.php
index 1c8613b..ed342e8 100644
--- a/src/charts/line.php
+++ b/src/charts/line.php
@@ -350,7 +350,8 @@ class ezcGraphLineChart extends ezcGraphChart
}
// Store stacked value for next iteration
- $stacked[(int) ( $point->x * 10000 )][$point->y / abs( $point->y )] = $point;
+ $side = ( $point->y == 0 ? 1 : $point->y / abs( $point->y ) );
+ $stacked[(int) ( $point->x * 10000 )][$side] = $point;
$renderer->drawStackedBar(
$boundings,
diff --git a/tests/data/compare/ezcGraphLineChartTest_testStackedBarChartBug13253.svg b/tests/data/compare/ezcGraphLineChartTest_testStackedBarChartBug13253.svg
new file mode 100644
index 0000000..a3b4c6a
--- /dev/null
+++ b/tests/data/compare/ezcGraphLineChartTest_testStackedBarChartBug13253.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="500" 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 500.0000,0.0000 L 500.0000,200.0000 L 0.0000,200.0000 z " style="fill: #ffffff; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 100.0000,0.0000 L 100.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 100.0000,180.0000 L 500.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 492.0000,176.0000 L 500.0000,180.0000 L 492.0000,184.0000 L 492.0000,176.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_8"/><path d=" M 140.0000,200.0000 L 140.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 137.5000,5.0000 L 140.0000,0.0000 L 142.5000,5.0000 L 137.5000,5.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_10"/><path d=" M 204.0000,20.0000 L 204.0000,180.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_12"/><path d=" M 204.0000,177.0000 L 204.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 268.0000,20.0000 L 268.0000,180.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_15"/><path d=" M 268.0000,177.0000 L 268.0000,183.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" M 332.0000,20.0000 L 332.0000,180.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_18"/><path d=" M 332.0000,177.0000 L 332.0000,183.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_19"/><path d=" M 396.0000,20.0000 L 396.0000,180.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_21"/><path d=" M 396.0000,177.0000 L 396.0000,183.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_22"/><path d=" M 460.0000,20.0000 L 460.0000,180.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_24"/><path d=" M 460.0000,177.0000 L 460.0000,183.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_25"/><path d=" M 140.0000,172.0000 L 460.0000,172.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" M 140.0000,172.0000 L 141.0000,172.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_28"/><path d=" M 140.0000,164.0000 L 460.0000,164.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_29"/><path d=" M 140.0000,164.0000 L 141.0000,164.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_30"/><path d=" M 140.0000,156.0000 L 460.0000,156.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" M 140.0000,156.0000 L 141.0000,156.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_32"/><path d=" M 140.0000,148.0000 L 460.0000,148.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 140.0000,148.0000 L 141.0000,148.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 140.0000,140.0000 L 460.0000,140.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><path d=" M 140.0000,140.0000 L 143.0000,140.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_36"/><path d=" M 140.0000,132.0000 L 460.0000,132.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_38"/><path d=" M 140.0000,132.0000 L 141.0000,132.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><path d=" M 140.0000,124.0000 L 460.0000,124.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" M 140.0000,124.0000 L 141.0000,124.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_41"/><path d=" M 140.0000,116.0000 L 460.0000,116.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_42"/><path d=" M 140.0000,116.0000 L 141.0000,116.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_43"/><path d=" M 140.0000,108.0000 L 460.0000,108.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_44"/><path d=" M 140.0000,108.0000 L 141.0000,108.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_45"/><path d=" M 140.0000,100.0000 L 460.0000,100.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_46"/><path d=" M 140.0000,100.0000 L 143.0000,100.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_47"/><path d=" M 140.0000,92.0000 L 460.0000,92.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_49"/><path d=" M 140.0000,92.0000 L 141.0000,92.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_50"/><path d=" M 140.0000,84.0000 L 460.0000,84.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_51"/><path d=" M 140.0000,84.0000 L 141.0000,84.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_52"/><path d=" M 140.0000,76.0000 L 460.0000,76.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_53"/><path d=" M 140.0000,76.0000 L 141.0000,76.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_54"/><path d=" M 140.0000,68.0000 L 460.0000,68.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_55"/><path d=" M 140.0000,68.0000 L 141.0000,68.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_56"/><path d=" M 140.0000,60.0000 L 460.0000,60.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_57"/><path d=" M 140.0000,60.0000 L 143.0000,60.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_58"/><path d=" M 140.0000,52.0000 L 460.0000,52.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_60"/><path d=" M 140.0000,52.0000 L 141.0000,52.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_61"/><path d=" M 140.0000,44.0000 L 460.0000,44.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_62"/><path d=" M 140.0000,44.0000 L 141.0000,44.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_63"/><path d=" M 140.0000,36.0000 L 460.0000,36.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_64"/><path d=" M 140.0000,36.0000 L 141.0000,36.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_65"/><path d=" M 140.0000,28.0000 L 460.0000,28.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_66"/><path d=" M 140.0000,28.0000 L 141.0000,28.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_67"/><path d=" M 140.0000,20.0000 L 460.0000,20.0000" style="fill: none; stroke: #d3d7df; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_68"/><path d=" M 140.0000,20.0000 L 143.0000,20.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_69"/><path d=" M 200.8450,180.0000 L 143.1550,180.0000 L 143.1550,92.0000 L 200.8450,92.0000 L 200.8450,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_71"/><path d=" M 143.6550,179.5000 L 143.6550,92.5000 L 200.3450,92.5000 L 200.3450,179.5000 L 143.6550,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_72"/><path d=" M 264.8450,180.0000 L 207.1550,180.0000 L 207.1550,140.0000 L 264.8450,140.0000 L 264.8450,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_73"/><path d=" M 207.6550,179.5000 L 207.6550,140.5000 L 264.3450,140.5000 L 264.3450,179.5000 L 207.6550,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_74"/><path d=" M 328.8450,180.0000 L 271.1550,180.0000 L 271.1550,164.0000 L 328.8450,164.0000 L 328.8450,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_75"/><path d=" M 271.6550,179.5000 L 271.6550,164.5000 L 328.3450,164.5000 L 328.3450,179.5000 L 271.6550,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_76"/><path d=" M 392.8450,180.0000 L 335.1550,180.0000 L 335.1550,164.0000 L 392.8450,164.0000 L 392.8450,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_77"/><path d=" M 335.6550,179.5000 L 335.6550,164.5000 L 392.3450,164.5000 L 392.3450,179.5000 L 335.6550,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_78"/><path d=" M 456.8450,180.0000 L 399.1550,180.0000 L 399.1550,172.0000 L 456.8450,172.0000 L 456.8450,180.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_79"/><path d=" M 399.6550,179.5000 L 399.6550,172.5000 L 456.3450,172.5000 L 456.3450,179.5000 L 399.6550,179.5000 z " style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_80"/><path d=" M 200.8450,92.0000 L 143.1550,92.0000 L 143.1550,20.0000 L 200.8450,20.0000 L 200.8450,92.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_81"/><path d=" M 143.6550,91.5000 L 143.6550,20.5000 L 200.3450,20.5000 L 200.3450,91.5000 L 143.6550,91.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_82"/><path d=" M 264.8450,140.0000 L 207.1550,140.0000 L 207.1550,20.0000 L 264.8450,20.0000 L 264.8450,140.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_83"/><path d=" M 207.6550,139.5000 L 207.6550,20.5000 L 264.3450,20.5000 L 264.3450,139.5000 L 207.6550,139.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_84"/><path d=" M 328.8450,164.0000 L 271.1550,164.0000 L 271.1550,20.0000 L 328.8450,20.0000 L 328.8450,164.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_85"/><path d=" M 271.6550,163.5000 L 271.6550,20.5000 L 328.3450,20.5000 L 328.3450,163.5000 L 271.6550,163.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_86"/><path d=" M 392.8450,164.0000 L 335.1550,164.0000 L 335.1550,20.0000 L 392.8450,20.0000 L 392.8450,164.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_87"/><path d=" M 335.6550,163.5000 L 335.6550,20.5000 L 392.3450,20.5000 L 392.3450,163.5000 L 335.6550,163.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_88"/><path d=" M 456.8450,172.0000 L 399.1550,172.0000 L 399.1550,20.0000 L 456.8450,20.0000 L 456.8450,172.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_89"/><path d=" M 399.6550,171.5000 L 399.6550,20.5000 L 456.3450,20.5000 L 456.3450,171.5000 L 399.6550,171.5000 z " style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_90"/><g id="ezcGraphTextBox_4"><path d=" M 16.5000,17.0000 L 16.5000,1.5000 L 62.5200,1.5000 L 62.5200,17.0000 L 16.5000,17.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_91"/><text id="ezcGraphTextBox_4_text" x="17.0000" text-length="44.5200px" y="13.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">values</text></g><g id="ezcGraphTextBox_6"><path d=" M 16.5000,35.0000 L 16.5000,19.5000 L 69.9400,19.5000 L 69.9400,35.0000 L 16.5000,35.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_92"/><text id="ezcGraphTextBox_6_text" x="17.0000" text-length="51.9400px" y="31.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">remains</text></g><g id="ezcGraphTextBox_11"><path d=" M 141.8200,197.0000 L 141.8200,181.5000 L 202.6800,181.5000 L 202.6800,197.0000 L 141.8200,197.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_93"/><text id="ezcGraphTextBox_11_text" x="142.3200" text-length="59.3600px" y="193.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">string 1</text></g><g id="ezcGraphTextBox_14"><path d=" M 205.8200,197.0000 L 205.8200,181.5000 L 266.6800,181.5000 L 266.6800,197.0000 L 205.8200,197.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_94"/><text id="ezcGraphTextBox_14_text" x="206.3200" text-length="59.3600px" y="193.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">string 2</text></g><g id="ezcGraphTextBox_17"><path d=" M 269.8200,197.0000 L 269.8200,181.5000 L 330.6800,181.5000 L 330.6800,197.0000 L 269.8200,197.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_95"/><text id="ezcGraphTextBox_17_text" x="270.3200" text-length="59.3600px" y="193.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">string 3</text></g><g id="ezcGraphTextBox_20"><path d=" M 333.8200,197.0000 L 333.8200,181.5000 L 394.6800,181.5000 L 394.6800,197.0000 L 333.8200,197.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_96"/><text id="ezcGraphTextBox_20_text" x="334.3200" text-length="59.3600px" y="193.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">string 4</text></g><g id="ezcGraphTextBox_23"><path d=" M 397.8200,197.0000 L 397.8200,181.5000 L 458.6800,181.5000 L 458.6800,197.0000 L 397.8200,197.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_97"/><text id="ezcGraphTextBox_23_text" x="398.3200" text-length="59.3600px" y="193.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">string 5</text></g><g id="ezcGraphTextBox_26"><path d=" M 128.8200,179.0000 L 128.8200,163.5000 L 139.0000,163.5000 L 139.0000,179.0000 L 128.8200,179.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_98"/><text id="ezcGraphTextBox_26_text" x="129.3200" text-length="8.6800px" y="175.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">0</text></g><g id="ezcGraphTextBox_37"><path d=" M 120.1400,139.0000 L 120.1400,123.5000 L 139.0000,123.5000 L 139.0000,139.0000 L 120.1400,139.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_99"/><text id="ezcGraphTextBox_37_text" x="120.6400" text-length="17.3600px" y="135.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">25</text></g><g id="ezcGraphTextBox_48"><path d=" M 120.1400,99.0000 L 120.1400,83.5000 L 139.0000,83.5000 L 139.0000,99.0000 L 120.1400,99.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_100"/><text id="ezcGraphTextBox_48_text" x="120.6400" text-length="17.3600px" y="95.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">50</text></g><g id="ezcGraphTextBox_59"><path d=" M 120.1400,59.0000 L 120.1400,43.5000 L 139.0000,43.5000 L 139.0000,59.0000 L 120.1400,59.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_101"/><text id="ezcGraphTextBox_59_text" x="120.6400" text-length="17.3600px" y="55.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">75</text></g><g id="ezcGraphTextBox_70"><path d=" M 111.4600,37.0000 L 111.4600,21.5000 L 139.0000,21.5000 L 139.0000,37.0000 L 111.4600,37.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_102"/><text id="ezcGraphTextBox_70_text" x="111.9600" text-length="26.0400px" y="33.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #2e3436; fill-opacity: 1.00; stroke: none;">100</text></g></g></svg>
diff --git a/tests/line_test.php b/tests/line_test.php
index a895da3..72ae0b8 100644
--- a/tests/line_test.php
+++ b/tests/line_test.php
@@ -1198,5 +1198,36 @@ class ezcGraphLineChartTest extends ezcGraphTestCase
$this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
);
}
+
+ public function testStackedBarChartBug13253()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+ $graph = new ezcGraphBarChart();
+
+ $graph->data['values'] = new ezcGraphArrayDataSet( array(
+ 'string 1' => 55,
+ 'string 2' => 25,
+ 'string 3' => 10,
+ 'string 4' => 10,
+ 'string 5' => 5,
+ ) );
+ $graph->data['remains'] = new ezcGraphArrayDataSet( array(
+ 'string 1' => 45,
+ 'string 2' => 75,
+ 'string 3' => 90,
+ 'string 4' => 90,
+ 'string 5' => 95,
+ ) );
+
+ $graph->palette = new ezcGraphPaletteEzRed();
+ $graph->options->stackBars = true;
+
+ $graph->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
}
?>
OpenPOWER on IntegriCloud