diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-10-26 08:58:18 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-10-26 08:58:18 +0000 |
commit | 7e56dbbe610469d173133cc6f2d19da5039079bb (patch) | |
tree | 8b76dbc4ef79ebc2ec3081fb8efe96c8a462672a /tests | |
parent | 6a1c516e3bd0ecfc6a3597f38f7a27abd0023d09 (diff) | |
download | zetacomponents-graph-7e56dbbe610469d173133cc6f2d19da5039079bb.zip zetacomponents-graph-7e56dbbe610469d173133cc6f2d19da5039079bb.tar.gz |
- Added tresh hold for pie charts
- Added test for custom sum in pie charts
Diffstat (limited to 'tests')
4 files changed, 55 insertions, 0 deletions
diff --git a/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithAbsoluteTreshHold.svg b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithAbsoluteTreshHold.svg new file mode 100644 index 0000000..4258e66 --- /dev/null +++ b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithAbsoluteTreshHold.svg @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" width="500" height="300" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,300.0000 L 0.0000,300.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 100.0000,0.0000 L 100.0000,300.0000 L 0.0000,300.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: #4e9a06; 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: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_5"/><path d=" M 2.0000,52.0000 L 2.0000,38.0000 L 16.0000,38.0000 L 16.0000,52.0000 L 2.0000,52.0000 z " style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_7"/><path d=" M 2.0000,70.0000 L 2.0000,56.0000 L 16.0000,56.0000 L 16.0000,70.0000 L 2.0000,70.0000 z " style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_9"/><path d=" M 2.0000,88.0000 L 2.0000,74.0000 L 16.0000,74.0000 L 16.0000,88.0000 L 2.0000,88.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_11"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 227.19,202.90 z" style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_13"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 227.19,202.90 z" style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_14"/><path d="M 300.00,150.00 L 227.19,202.90 A 90.00,90.00 0 0,1 210.71,138.72 z" style="fill: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_15"/><path d="M 300.00,150.00 L 227.19,202.90 A 90.00,90.00 0 0,1 210.71,138.72 z" style="fill: none; stroke: #660000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_16"/><path d="M 300.00,150.00 L 210.71,138.72 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_17"/><path d="M 300.00,150.00 L 210.71,138.72 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: none; stroke: #776a00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_18"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 261.68,68.57 z" style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_19"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 261.68,68.57 z" style="fill: none; stroke: #3b282e; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_20"/><path d="M 300.00,150.00 L 261.68,68.57 A 90.00,90.00 0 0,1 390.00,150.00 z" style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_21"/><path d="M 300.00,150.00 L 261.68,68.57 A 90.00,90.00 0 0,1 390.00,150.00 z" style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_22"/><path d=" M 257.5051,98.6325 L 231.4220,72.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_23"/><ellipse cx="257.50506735009" cy="98.632450481614" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_24"/><ellipse cx="231.42204861135" cy="72" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_25"/><path d=" M 238.0149,125.4584 L 201.0968,113.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><ellipse cx="238.01490094078" cy="125.45836315435" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_28"/><ellipse cx="201.09682459679" cy="113" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_29"/><path d=" M 235.4278,166.5793 L 196.9227,174.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><ellipse cx="235.42778925809" cy="166.57932581099" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_32"/><ellipse cx="196.92271120391" cy="174" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_33"/><path d=" M 335.7218,93.7115 L 358.6783,65.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><ellipse cx="335.72178633193" cy="93.711471633199" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_36"/><ellipse cx="358.67826876426" cy="65" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_37"/><path d=" M 320.6011,213.4038 L 337.2250,245.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><ellipse cx="320.60113295833" cy="213.40376775301" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_40"/><ellipse cx="337.22498999199" cy="245" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_41"/><text id="ezcGraphTextBox_4" x="17" text-length="66.78px" y="13.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian</text><text id="ezcGraphTextBox_6" x="17" text-length="37.1px" y="31.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch</text><text id="ezcGraphTextBox_8" x="17" text-length="44.52px" y="49.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German</text><text id="ezcGraphTextBox_10" x="17" text-length="44.52px" y="67.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French</text><text id="ezcGraphTextBox_12" x="17" text-length="29.68px" y="85.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Misc</text><text id="ezcGraphTextBox_26" x="106.70204861135" text-length="118.72px" y="76.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French: 2 (8.0%)</text><text id="ezcGraphTextBox_30" x="128.31682459679" text-length="66.78px" y="110.85" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German: 2</text><text id="ezcGraphTextBox_30" x="150.57682459679" text-length="44.52px" y="126.25" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(8.0%)</text><text id="ezcGraphTextBox_34" x="131.56271120391" text-length="59.36px" y="171.85" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch: 3</text><text id="ezcGraphTextBox_34" x="138.98271120391" text-length="51.94px" y="187.25" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(12.0%)</text><text id="ezcGraphTextBox_38" x="364.67826876426" text-length="111.3px" y="69.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Misc: 8 (32.0%)</text><text id="ezcGraphTextBox_42" x="343.22498999199" text-length="155.82px" y="249.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian: 10 (40.0%)</text></g></svg> diff --git a/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithCustomSum.svg b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithCustomSum.svg new file mode 100644 index 0000000..ae5e2e6 --- /dev/null +++ b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithCustomSum.svg @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" width="500" height="300" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,300.0000 L 0.0000,300.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 100.0000,0.0000 L 100.0000,300.0000 L 0.0000,300.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: #4e9a06; 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: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_5"/><path d=" M 2.0000,52.0000 L 2.0000,38.0000 L 16.0000,38.0000 L 16.0000,52.0000 L 2.0000,52.0000 z " style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_7"/><path d=" M 2.0000,70.0000 L 2.0000,56.0000 L 16.0000,56.0000 L 16.0000,70.0000 L 2.0000,70.0000 z " style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_9"/><path d=" M 2.0000,88.0000 L 2.0000,74.0000 L 16.0000,74.0000 L 16.0000,88.0000 L 2.0000,88.0000 z " style="fill: #f57900; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_11"/><path d=" M 2.0000,106.0000 L 2.0000,92.0000 L 16.0000,92.0000 L 16.0000,106.0000 L 2.0000,106.0000 z " style="fill: #204a87; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_13"/><path d=" M 2.0000,124.0000 L 2.0000,110.0000 L 16.0000,110.0000 L 16.0000,124.0000 L 2.0000,124.0000 z " style="fill: #c17d11; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_15"/><path d=" M 2.0000,142.0000 L 2.0000,128.0000 L 16.0000,128.0000 L 16.0000,142.0000 L 2.0000,142.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_17"/><path d=" M 2.0000,160.0000 L 2.0000,146.0000 L 16.0000,146.0000 L 16.0000,160.0000 L 2.0000,160.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_19"/><path d=" M 2.0000,178.0000 L 2.0000,164.0000 L 16.0000,164.0000 L 16.0000,178.0000 L 2.0000,178.0000 z " style="fill: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_21"/><path d=" M 2.0000,196.0000 L 2.0000,182.0000 L 16.0000,182.0000 L 16.0000,196.0000 L 2.0000,196.0000 z " style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_23"/><path d=" M 2.0000,214.0000 L 2.0000,200.0000 L 16.0000,200.0000 L 16.0000,214.0000 L 2.0000,214.0000 z " style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_25"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 255.00,227.94 z" style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_27"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 255.00,227.94 z" style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_28"/><path d="M 300.00,150.00 L 255.00,227.94 A 90.00,90.00 0 0,1 217.78,186.61 z" style="fill: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_29"/><path d="M 300.00,150.00 L 255.00,227.94 A 90.00,90.00 0 0,1 217.78,186.61 z" style="fill: none; stroke: #660000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_30"/><path d="M 300.00,150.00 L 217.78,186.61 A 90.00,90.00 0 0,1 210.00,150.00 z" style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_31"/><path d="M 300.00,150.00 L 217.78,186.61 A 90.00,90.00 0 0,1 210.00,150.00 z" style="fill: none; stroke: #776a00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_32"/><path d="M 300.00,150.00 L 210.00,150.00 A 90.00,90.00 0 0,1 217.78,113.39 z" style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_33"/><path d="M 300.00,150.00 L 210.00,150.00 A 90.00,90.00 0 0,1 217.78,113.39 z" style="fill: none; stroke: #3b282e; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_34"/><path d="M 300.00,150.00 L 217.78,113.39 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: #f57900; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_35"/><path d="M 300.00,150.00 L 217.78,113.39 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: none; stroke: #7b3d00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_36"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 239.78,83.12 z" style="fill: #204a87; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_37"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 239.78,83.12 z" style="fill: none; stroke: #102544; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_38"/><path d="M 300.00,150.00 L 239.78,83.12 A 90.00,90.00 0 0,1 255.00,72.06 z" style="fill: #c17d11; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_39"/><path d="M 300.00,150.00 L 239.78,83.12 A 90.00,90.00 0 0,1 255.00,72.06 z" style="fill: none; stroke: #613f09; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_40"/><path d="M 300.00,150.00 L 255.00,72.06 A 90.00,90.00 0 0,1 272.19,64.40 z" style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_41"/><path d="M 300.00,150.00 L 255.00,72.06 A 90.00,90.00 0 0,1 272.19,64.40 z" style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_42"/><path d="M 300.00,150.00 L 272.19,64.40 A 90.00,90.00 0 0,1 290.59,60.49 z" style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_43"/><path d="M 300.00,150.00 L 272.19,64.40 A 90.00,90.00 0 0,1 290.59,60.49 z" style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_44"/><path d="M 300.00,150.00 L 290.59,60.49 A 90.00,90.00 0 0,1 309.41,60.49 z" style="fill: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_45"/><path d="M 300.00,150.00 L 290.59,60.49 A 90.00,90.00 0 0,1 309.41,60.49 z" style="fill: none; stroke: #660000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_46"/><path d="M 300.00,150.00 L 309.41,60.49 A 90.00,90.00 0 0,1 327.81,64.40 z" style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_47"/><path d="M 300.00,150.00 L 309.41,60.49 A 90.00,90.00 0 0,1 327.81,64.40 z" style="fill: none; stroke: #776a00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_48"/><path d="M 300.00,150.00 L 327.81,64.40 A 90.00,90.00 0 0,1 345.00,72.06 z" style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_49"/><path d="M 300.00,150.00 L 327.81,64.40 A 90.00,90.00 0 0,1 345.00,72.06 z" style="fill: none; stroke: #3b282e; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_50"/><path d=" M 300.0000,83.3333 L 294.0000,50.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_51"/><ellipse cx="300" cy="83.333333333333" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_52"/><ellipse cx="294" cy="50" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_53"/><path d=" M 286.1392,84.7902 L 228.4915,74.4444" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_55"/><ellipse cx="286.13922061215" cy="84.79015995108" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_56"/><ellipse cx="228.49154234229" cy="74.444444444444" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_57"/><path d=" M 272.8842,89.0970 L 208.0485,98.8889" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_59"/><ellipse cx="272.88422379495" cy="89.096969490493" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_60"/><ellipse cx="208.04853508527" cy="98.888888888889" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_61"/><path d=" M 260.8143,96.0655 L 197.6211,123.3333" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_63"/><ellipse cx="260.81431651384" cy="96.065533708337" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_64"/><ellipse cx="197.62111803466" cy="123.33333333333" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_65"/><path d=" M 250.4570,105.3913 L 194.0247,147.7778" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_67"/><ellipse cx="250.45701163484" cy="105.39129290941" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_68"/><ellipse cx="194.02469440709" cy="147.77777777778" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_69"/><path d=" M 242.2650,116.6667 L 196.5004,172.2222" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_71"/><ellipse cx="242.26497308104" cy="116.66666666667" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_72"/><ellipse cx="196.50039569564" cy="172.22222222222" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_73"/><path d=" M 234.7902,136.1392 L 205.5567,196.6667" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_75"/><ellipse cx="234.79015995108" cy="136.13922061215" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_76"/><ellipse cx="205.55667225719" cy="196.66666666667" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_77"/><path d=" M 234.7902,163.8608 L 223.6920,221.1111" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_79"/><ellipse cx="234.79015995108" cy="163.86077938785" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_80"/><ellipse cx="223.69203546864" cy="221.11111111111" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_81"/><path d=" M 250.4570,194.6087 L 264.5189,245.5556" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_83"/><ellipse cx="250.45701163484" cy="194.60870709059" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_84"/><ellipse cx="264.5188907524" cy="245.55555555556" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_85"/><path d=" M 313.8608,84.7902 L 325.8997,52.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_87"/><ellipse cx="313.86077938785" cy="84.79015995108" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_88"/><ellipse cx="325.89974874213" cy="52" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_89"/><path d=" M 327.1158,89.0970 L 373.7464,76.4444" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_91"/><ellipse cx="327.11577620505" cy="89.096969490493" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_92"/><ellipse cx="373.74644084314" cy="76.444444444444" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_93"/><path d=" M 333.3333,207.7350 L 357.0294,236.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_95"/><ellipse cx="333.33333333333" cy="207.73502691896" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_96"/><ellipse cx="357.02940328869" cy="236" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_97"/><text id="ezcGraphTextBox_4" x="17" text-length="66.78px" y="13.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian</text><text id="ezcGraphTextBox_6" x="17" text-length="37.1px" y="31.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch</text><text id="ezcGraphTextBox_8" x="17" text-length="44.52px" y="49.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German</text><text id="ezcGraphTextBox_10" x="17" text-length="44.52px" y="67.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French</text><text id="ezcGraphTextBox_12" x="17" text-length="37.1px" y="85.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Hindi</text><text id="ezcGraphTextBox_14" x="17" text-length="66.78px" y="103.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Taiwanese</text><text id="ezcGraphTextBox_16" x="17" text-length="66.78px" y="121.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Brazilian</text><text id="ezcGraphTextBox_18" x="17" text-length="74.2px" y="139.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Venezuelan</text><text id="ezcGraphTextBox_20" x="17" text-length="59.36px" y="157.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Japanese</text><text id="ezcGraphTextBox_22" x="17" text-length="37.1px" y="175.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Czech</text><text id="ezcGraphTextBox_24" x="17" text-length="66.78px" y="193.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Hungarian</text><text id="ezcGraphTextBox_26" x="17" text-length="59.36px" y="211.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Romanian</text><text id="ezcGraphTextBox_54" x="200.55" text-length="87.45px" y="53.85" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Czech: 1 (3.3%)</text><text id="ezcGraphTextBox_58" x="117.55154234229" text-length="104.94px" y="78.294444444444" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Japanese: 1 (3.3%)</text><text id="ezcGraphTextBox_62" x="126.25853508527" text-length="75.79px" y="97.188888888889" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Venezuelan: 1</text><text id="ezcGraphTextBox_62" x="167.06853508527" text-length="34.98px" y="109.28888888889" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(3.3%)</text><text id="ezcGraphTextBox_66" x="121.66111803466" text-length="69.96px" y="121.63333333333" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Brazilian: 1</text><text id="ezcGraphTextBox_66" x="156.64111803466" text-length="34.98px" y="133.73333333333" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(3.3%)</text><text id="ezcGraphTextBox_70" x="118.06469440709" text-length="69.96px" y="146.07777777778" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Taiwanese: 1</text><text id="ezcGraphTextBox_70" x="153.04469440709" text-length="34.98px" y="158.17777777778" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(3.3%)</text><text id="ezcGraphTextBox_74" x="143.86039569564" text-length="46.64px" y="170.52222222222" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Hindi: 1</text><text id="ezcGraphTextBox_74" x="155.52039569564" text-length="34.98px" y="182.62222222222" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(3.3%)</text><text id="ezcGraphTextBox_78" x="106.27667225719" text-length="93.28px" y="200.51666666667" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French: 2 (6.7%)</text><text id="ezcGraphTextBox_82" x="124.41203546864" text-length="93.28px" y="224.96111111111" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German: 2 (6.7%)</text><text id="ezcGraphTextBox_86" x="165.2388907524" text-length="93.28px" y="249.40555555556" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch: 3 (10.0%)</text><text id="ezcGraphTextBox_90" x="331.89974874213" text-length="110.77px" y="55.85" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Hungarian: 1 (3.3%)</text><text id="ezcGraphTextBox_94" x="379.74644084314" text-length="104.94px" y="80.294444444444" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Romanian: 1 (3.3%)</text><text id="ezcGraphTextBox_98" x="363.02940328869" text-length="122.43px" y="239.85" style="font-size: 11px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian: 10 (33.3%)</text></g></svg> diff --git a/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithPercentageTreshHold.svg b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithPercentageTreshHold.svg new file mode 100644 index 0000000..48107ba --- /dev/null +++ b/tests/data/compare/ezcGraphPieChartTest_testRenderPieChartWithPercentageTreshHold.svg @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" width="500" height="300" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,300.0000 L 0.0000,300.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 0.0000,300.0000 L 0.0000,0.0000 L 100.0000,0.0000 L 100.0000,300.0000 L 0.0000,300.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: #4e9a06; 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: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_5"/><path d=" M 2.0000,52.0000 L 2.0000,38.0000 L 16.0000,38.0000 L 16.0000,52.0000 L 2.0000,52.0000 z " style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_7"/><path d=" M 2.0000,70.0000 L 2.0000,56.0000 L 16.0000,56.0000 L 16.0000,70.0000 L 2.0000,70.0000 z " style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_9"/><path d=" M 2.0000,88.0000 L 2.0000,74.0000 L 16.0000,74.0000 L 16.0000,88.0000 L 2.0000,88.0000 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_11"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 227.19,202.90 z" style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_13"/><path d="M 300.00,150.00 L 390.00,150.00 A 90.00,90.00 0 0,1 227.19,202.90 z" style="fill: none; stroke: #274d03; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_14"/><path d="M 300.00,150.00 L 227.19,202.90 A 90.00,90.00 0 0,1 210.71,138.72 z" style="fill: #cc0000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_15"/><path d="M 300.00,150.00 L 227.19,202.90 A 90.00,90.00 0 0,1 210.71,138.72 z" style="fill: none; stroke: #660000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_16"/><path d="M 300.00,150.00 L 210.71,138.72 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: #edd400; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_17"/><path d="M 300.00,150.00 L 210.71,138.72 A 90.00,90.00 0 0,1 227.19,97.10 z" style="fill: none; stroke: #776a00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_18"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 261.68,68.57 z" style="fill: #75505b; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_19"/><path d="M 300.00,150.00 L 227.19,97.10 A 90.00,90.00 0 0,1 261.68,68.57 z" style="fill: none; stroke: #3b282e; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_20"/><path d="M 300.00,150.00 L 261.68,68.57 A 90.00,90.00 0 0,1 390.00,150.00 z" style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_21"/><path d="M 300.00,150.00 L 261.68,68.57 A 90.00,90.00 0 0,1 390.00,150.00 z" style="fill: none; stroke: #1a3352; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphCircleSector_22"/><path d=" M 257.5051,98.6325 L 231.4220,72.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_23"/><ellipse cx="257.50506735009" cy="98.632450481614" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_24"/><ellipse cx="231.42204861135" cy="72" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_25"/><path d=" M 238.0149,125.4584 L 201.0968,113.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><ellipse cx="238.01490094078" cy="125.45836315435" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_28"/><ellipse cx="201.09682459679" cy="113" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_29"/><path d=" M 235.4278,166.5793 L 196.9227,174.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><ellipse cx="235.42778925809" cy="166.57932581099" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_32"/><ellipse cx="196.92271120391" cy="174" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_33"/><path d=" M 335.7218,93.7115 L 358.6783,65.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><ellipse cx="335.72178633193" cy="93.711471633199" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_36"/><ellipse cx="358.67826876426" cy="65" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_37"/><path d=" M 320.6011,213.4038 L 337.2250,245.0000" style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><ellipse cx="320.60113295833" cy="213.40376775301" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_40"/><ellipse cx="337.22498999199" cy="245" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_41"/><text id="ezcGraphTextBox_4" x="17" text-length="66.78px" y="13.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian</text><text id="ezcGraphTextBox_6" x="17" text-length="37.1px" y="31.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch</text><text id="ezcGraphTextBox_8" x="17" text-length="44.52px" y="49.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German</text><text id="ezcGraphTextBox_10" x="17" text-length="44.52px" y="67.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French</text><text id="ezcGraphTextBox_12" x="17" text-length="44.52px" y="85.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Others</text><text id="ezcGraphTextBox_26" x="106.70204861135" text-length="118.72px" y="76.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">French: 2 (8.0%)</text><text id="ezcGraphTextBox_30" x="128.31682459679" text-length="66.78px" y="110.85" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">German: 2</text><text id="ezcGraphTextBox_30" x="150.57682459679" text-length="44.52px" y="126.25" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(8.0%)</text><text id="ezcGraphTextBox_34" x="131.56271120391" text-length="59.36px" y="171.85" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dutch: 3</text><text id="ezcGraphTextBox_34" x="138.98271120391" text-length="51.94px" y="187.25" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">(12.0%)</text><text id="ezcGraphTextBox_38" x="364.67826876426" text-length="126.14px" y="69.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Others: 8 (32.0%)</text><text id="ezcGraphTextBox_42" x="343.22498999199" text-length="155.82px" y="249.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Norwegian: 10 (40.0%)</text></g></svg> diff --git a/tests/pie_test.php b/tests/pie_test.php index 2b4069f..60ea879 100644 --- a/tests/pie_test.php +++ b/tests/pie_test.php @@ -257,5 +257,54 @@ class ezcGraphPieChartTest extends ezcImageTestCase $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } + + public function testRenderPieChartWithCustomSum() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $chart = new ezcGraphPieChart(); + $chart->options->sum = 30; + $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 'Norwegian' => 10, 'Dutch' => 3, 'German' => 2, 'French' => 2, 'Hindi' => 1, 'Taiwanese' => 1, 'Brazilian' => 1, 'Venezuelan' => 1, 'Japanese' => 1, 'Czech' => 1, 'Hungarian' => 1, 'Romanian' => 1 ) ); + + $chart->render( 500, 300, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderPieChartWithAbsoluteTreshHold() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $chart = new ezcGraphPieChart(); + $chart->options->absoluteTreshHold = 1; + $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 'Norwegian' => 10, 'Dutch' => 3, 'German' => 2, 'French' => 2, 'Hindi' => 1, 'Taiwanese' => 1, 'Brazilian' => 1, 'Venezuelan' => 1, 'Japanese' => 1, 'Czech' => 1, 'Hungarian' => 1, 'Romanian' => 1 ) ); + + $chart->render( 500, 300, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderPieChartWithPercentageTreshHold() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $chart = new ezcGraphPieChart(); + $chart->options->percentTreshHold = .05; + $chart->options->summarizeCaption = 'Others'; + $chart->data['Skien'] = new ezcGraphArrayDataSet( array( 'Norwegian' => 10, 'Dutch' => 3, 'German' => 2, 'French' => 2, 'Hindi' => 1, 'Taiwanese' => 1, 'Brazilian' => 1, 'Venezuelan' => 1, 'Japanese' => 1, 'Czech' => 1, 'Hungarian' => 1, 'Romanian' => 1 ) ); + + $chart->render( 500, 300, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } } ?> |