summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2009-01-20 11:42:06 +0000
committerKore Nordmann <github@kore-nordmann.de>2009-01-20 11:42:06 +0000
commitaf6c8b78b44a48da82b94c0f47b248a66f54d275 (patch)
tree43b5a8581d872ed701838a9b973d99f861db041c
parentc8e553c98361944727f7ae933e5fc89d7ba5956c (diff)
downloadzetacomponents-graph-af6c8b78b44a48da82b94c0f47b248a66f54d275.zip
zetacomponents-graph-af6c8b78b44a48da82b94c0f47b248a66f54d275.tar.gz
- Implamented feature #14146: Add new data symbols - square and box
-rw-r--r--ChangeLog1
-rw-r--r--src/graph.php8
-rw-r--r--src/interfaces/renderer.php13
-rw-r--r--tests/data/compare/ezcGraphRenderer2dTest_testSquareAndBoxSymbolsInChart.svg2
-rw-r--r--tests/renderer_2d_test.php66
5 files changed, 90 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e8c005..ce492c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
axis
- Implemented feature #13634: Make Offset of ezcGraphAxisRotatedLabelRenderer
optional
+- Implamented feature #14146: Add new data symbols - square and box
1.4 - Monday 05 January 2009
diff --git a/src/graph.php b/src/graph.php
index 1bfc924..14a1b3b 100644
--- a/src/graph.php
+++ b/src/graph.php
@@ -36,6 +36,14 @@ class ezcGraph
* symbol.
*/
const ARROW = 4;
+ /**
+ * A square, filled box, symbol
+ */
+ const SQUARE = 5;
+ /**
+ * A non-filled box symbol
+ */
+ const BOX = 6;
/**
* Constant used for background repetition. No repeat.
diff --git a/src/interfaces/renderer.php b/src/interfaces/renderer.php
index 090b947..f87257e 100644
--- a/src/interfaces/renderer.php
+++ b/src/interfaces/renderer.php
@@ -488,6 +488,7 @@ abstract class ezcGraphRenderer
switch ( $symbol )
{
case ezcGraph::NO_SYMBOL:
+ case ezcGraph::SQUARE:
$return = $this->driver->drawPolygon(
array(
new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ),
@@ -531,6 +532,18 @@ abstract class ezcGraphRenderer
);
}
return $return;
+ case ezcGraph::BOX:
+ $return = $this->driver->drawPolygon(
+ array(
+ new ezcGraphCoordinate( $boundings->x0, $boundings->y0 ),
+ new ezcGraphCoordinate( $boundings->x1, $boundings->y0 ),
+ new ezcGraphCoordinate( $boundings->x1, $boundings->y1 ),
+ new ezcGraphCoordinate( $boundings->x0, $boundings->y1 ),
+ ),
+ $color,
+ false
+ );
+ return $return;
case ezcGraph::DIAMOND:
$return = $this->driver->drawPolygon(
array(
diff --git a/tests/data/compare/ezcGraphRenderer2dTest_testSquareAndBoxSymbolsInChart.svg b/tests/data/compare/ezcGraphRenderer2dTest_testSquareAndBoxSymbolsInChart.svg
new file mode 100644
index 0000000..d95db2f
--- /dev/null
+++ b/tests/data/compare/ezcGraphRenderer2dTest_testSquareAndBoxSymbolsInChart.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="560" height="250" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 0.0000,250.0000 L 0.0000,0.0000 L 560.0000,0.0000 L 560.0000,250.0000 L 0.0000,250.0000 z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_1"/><path d=" M 1.0000,249.0000 L 1.0000,1.0000 L 111.0000,1.0000 L 111.0000,249.0000 L 1.0000,249.0000 z " style="fill: #000000; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M 1.5000,1.5000 L 110.5000,1.5000 L 110.5000,248.5000 L 1.5000,248.5000 L 1.5000,1.5000 z " style="fill: none; stroke: #555753; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_3"/><path d=" M 4.0000,18.0000 L 4.0000,4.0000 L 18.0000,4.0000 L 18.0000,18.0000 L 4.0000,18.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_4"/><path d=" M 4.5000,22.5000 L 17.5000,22.5000 L 17.5000,35.5000 L 4.5000,35.5000 L 4.5000,22.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_6"/><path d=" M 112.0000,225.0000 L 560.0000,225.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_8"/><path d=" M 552.0000,221.0000 L 560.0000,225.0000 L 552.0000,229.0000 L 552.0000,221.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_9"/><path d=" M 156.8000,250.0000 L 156.8000,0.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_10"/><path d=" M 153.8000,6.0000 L 156.8000,0.0000 L 159.8000,6.0000 L 153.8000,6.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_11"/><path d=" M 246.4000,25.0000 L 246.4000,225.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_12"/><path d=" M 246.4000,222.0000 L 246.4000,225.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_13"/><path d=" M 336.0000,25.0000 L 336.0000,225.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_15"/><path d=" M 336.0000,222.0000 L 336.0000,225.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" M 425.6000,25.0000 L 425.6000,225.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_18"/><path d=" M 425.6000,222.0000 L 425.6000,225.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_19"/><path d=" M 515.2000,25.0000 L 515.2000,225.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_21"/><path d=" M 515.2000,222.0000 L 515.2000,225.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_22"/><path d=" M 156.8000,215.0000 L 515.2000,215.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_25"/><path d=" M 156.8000,215.0000 L 157.8000,215.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_26"/><path d=" M 156.8000,205.0000 L 515.2000,205.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" M 156.8000,205.0000 L 157.8000,205.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_28"/><path d=" M 156.8000,195.0000 L 515.2000,195.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_29"/><path d=" M 156.8000,195.0000 L 157.8000,195.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_30"/><path d=" M 156.8000,185.0000 L 515.2000,185.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" M 156.8000,185.0000 L 157.8000,185.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_32"/><path d=" M 156.8000,175.0000 L 515.2000,175.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_33"/><path d=" M 156.8000,175.0000 L 159.8000,175.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_34"/><path d=" M 156.8000,165.0000 L 515.2000,165.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_36"/><path d=" M 156.8000,165.0000 L 157.8000,165.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_37"/><path d=" M 156.8000,155.0000 L 515.2000,155.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_38"/><path d=" M 156.8000,155.0000 L 157.8000,155.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_39"/><path d=" M 156.8000,145.0000 L 515.2000,145.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" M 156.8000,145.0000 L 157.8000,145.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_41"/><path d=" M 156.8000,135.0000 L 515.2000,135.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_42"/><path d=" M 156.8000,135.0000 L 157.8000,135.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_43"/><path d=" M 156.8000,125.0000 L 515.2000,125.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_44"/><path d=" M 156.8000,125.0000 L 159.8000,125.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_45"/><path d=" M 156.8000,115.0000 L 515.2000,115.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_47"/><path d=" M 156.8000,115.0000 L 157.8000,115.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_48"/><path d=" M 156.8000,105.0000 L 515.2000,105.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_49"/><path d=" M 156.8000,105.0000 L 157.8000,105.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_50"/><path d=" M 156.8000,95.0000 L 515.2000,95.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_51"/><path d=" M 156.8000,95.0000 L 157.8000,95.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_52"/><path d=" M 156.8000,85.0000 L 515.2000,85.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_53"/><path d=" M 156.8000,85.0000 L 157.8000,85.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_54"/><path d=" M 156.8000,75.0000 L 515.2000,75.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_55"/><path d=" M 156.8000,75.0000 L 159.8000,75.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_56"/><path d=" M 156.8000,65.0000 L 515.2000,65.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_58"/><path d=" M 156.8000,65.0000 L 157.8000,65.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_59"/><path d=" M 156.8000,55.0000 L 515.2000,55.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_60"/><path d=" M 156.8000,55.0000 L 157.8000,55.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_61"/><path d=" M 156.8000,45.0000 L 515.2000,45.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_62"/><path d=" M 156.8000,45.0000 L 157.8000,45.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_63"/><path d=" M 156.8000,35.0000 L 515.2000,35.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 0.47; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_64"/><path d=" M 156.8000,35.0000 L 157.8000,35.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_65"/><path d=" M 156.8000,25.0000 L 515.2000,25.0000" style="fill: none; stroke: #888a85; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_66"/><path d=" M 156.8000,25.0000 L 159.8000,25.0000" style="fill: none; stroke: #eeeeec; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_67"/><path d=" M 156.8000,205.0000 L 156.8000,205.0000" style="fill: none; stroke: #729fcf; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_69"/><path d=" M 156.8000,205.0000 L 246.4000,145.0000" style="fill: none; stroke: #729fcf; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_70"/><path d=" M 246.4000,145.0000 L 336.0000,105.0000" style="fill: none; stroke: #729fcf; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_71"/><path d=" M 336.0000,105.0000 L 425.6000,65.0000" style="fill: none; stroke: #729fcf; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_72"/><path d=" M 425.6000,65.0000 L 515.2000,185.0000" style="fill: none; stroke: #729fcf; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_73"/><path d=" M 156.8000,145.0000 L 156.8000,145.0000" style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_74"/><path d=" M 156.8000,145.0000 L 246.4000,105.0000" style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_75"/><path d=" M 246.4000,105.0000 L 336.0000,65.0000" style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_76"/><path d=" M 336.0000,65.0000 L 425.6000,185.0000" style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_77"/><path d=" M 425.6000,185.0000 L 515.2000,205.0000" style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_78"/><path d=" M 153.8000,208.0000 L 153.8000,202.0000 L 159.8000,202.0000 L 159.8000,208.0000 L 153.8000,208.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_79"/><path d=" M 243.4000,148.0000 L 243.4000,142.0000 L 249.4000,142.0000 L 249.4000,148.0000 L 243.4000,148.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_80"/><path d=" M 333.0000,108.0000 L 333.0000,102.0000 L 339.0000,102.0000 L 339.0000,108.0000 L 333.0000,108.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_81"/><path d=" M 422.6000,68.0000 L 422.6000,62.0000 L 428.6000,62.0000 L 428.6000,68.0000 L 422.6000,68.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_82"/><path d=" M 512.2000,188.0000 L 512.2000,182.0000 L 518.2000,182.0000 L 518.2000,188.0000 L 512.2000,188.0000 z " style="fill: #729fcf; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_83"/><path d=" M 154.3000,142.5000 L 159.3000,142.5000 L 159.3000,147.5000 L 154.3000,147.5000 L 154.3000,142.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_84"/><path d=" M 243.9000,102.5000 L 248.9000,102.5000 L 248.9000,107.5000 L 243.9000,107.5000 L 243.9000,102.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_85"/><path d=" M 333.5000,62.5000 L 338.5000,62.5000 L 338.5000,67.5000 L 333.5000,67.5000 L 333.5000,62.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_86"/><path d=" M 423.1000,182.5000 L 428.1000,182.5000 L 428.1000,187.5000 L 423.1000,187.5000 L 423.1000,182.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_87"/><path d=" M 512.7000,202.5000 L 517.7000,202.5000 L 517.7000,207.5000 L 512.7000,207.5000 L 512.7000,202.5000 z " style="fill: none; stroke: #ef2929; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_88"/><g id="ezcGraphTextBox_5"><path d=" M 18.5000,19.0000 L 18.5000,3.5000 L 71.9400,3.5000 L 71.9400,19.0000 L 18.5000,19.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_89"/><text id="ezcGraphTextBox_5_text" x="19.0000" text-length="51.9400px" y="15.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">sample1</text></g><g id="ezcGraphTextBox_7"><path d=" M 18.5000,37.0000 L 18.5000,21.5000 L 71.9400,21.5000 L 71.9400,37.0000 L 18.5000,37.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_90"/><text id="ezcGraphTextBox_7_text" x="19.0000" text-length="51.9400px" y="33.9000" style="font-size: 14px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">sample2</text></g><g id="ezcGraphTextBox_14"><path d=" M 239.3900,249.0000 L 239.3900,226.5000 L 253.9100,226.5000 L 253.9100,249.0000 L 239.3900,249.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_91"/><text id="ezcGraphTextBox_14_text" x="239.8900" text-length="13.0200px" y="244.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">1</text></g><g id="ezcGraphTextBox_17"><path d=" M 328.9900,249.0000 L 328.9900,226.5000 L 343.5100,226.5000 L 343.5100,249.0000 L 328.9900,249.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_92"/><text id="ezcGraphTextBox_17_text" x="329.4900" text-length="13.0200px" y="244.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">2</text></g><g id="ezcGraphTextBox_20"><path d=" M 418.5900,249.0000 L 418.5900,226.5000 L 433.1100,226.5000 L 433.1100,249.0000 L 418.5900,249.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_93"/><text id="ezcGraphTextBox_20_text" x="419.0900" text-length="13.0200px" y="244.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">3</text></g><g id="ezcGraphTextBox_23"><path d=" M 508.1900,249.0000 L 508.1900,226.5000 L 522.7100,226.5000 L 522.7100,249.0000 L 508.1900,249.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_94"/><text id="ezcGraphTextBox_23_text" x="508.6900" text-length="13.0200px" y="244.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">4</text></g><g id="ezcGraphTextBox_24"><path d=" M 141.2800,224.0000 L 141.2800,201.5000 L 155.8000,201.5000 L 155.8000,224.0000 L 141.2800,224.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_95"/><text id="ezcGraphTextBox_24_text" x="141.7800" text-length="13.0200px" y="219.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">0</text></g><g id="ezcGraphTextBox_35"><path d=" M 115.2400,174.0000 L 115.2400,151.5000 L 155.8000,151.5000 L 155.8000,174.0000 L 115.2400,174.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_96"/><text id="ezcGraphTextBox_35_text" x="115.7400" text-length="39.0600px" y="169.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">2.5</text></g><g id="ezcGraphTextBox_46"><path d=" M 141.2800,124.0000 L 141.2800,101.5000 L 155.8000,101.5000 L 155.8000,124.0000 L 141.2800,124.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_97"/><text id="ezcGraphTextBox_46_text" x="141.7800" text-length="13.0200px" y="119.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">5</text></g><g id="ezcGraphTextBox_57"><path d=" M 115.2400,74.0000 L 115.2400,51.5000 L 155.8000,51.5000 L 155.8000,74.0000 L 115.2400,74.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_98"/><text id="ezcGraphTextBox_57_text" x="115.7400" text-length="39.0600px" y="69.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">7.5</text></g><g id="ezcGraphTextBox_68"><path d=" M 128.2600,49.0000 L 128.2600,26.5000 L 155.8000,26.5000 L 155.8000,49.0000 L 128.2600,49.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_99"/><text id="ezcGraphTextBox_68_text" x="128.7600" text-length="26.0400px" y="44.8500" style="font-size: 21px; font-family: 'sans-serif'; fill: #d3d7cf; fill-opacity: 1.00; stroke: none;">10</text></g></g></svg>
diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php
index 49582fd..097d30f 100644
--- a/tests/renderer_2d_test.php
+++ b/tests/renderer_2d_test.php
@@ -716,6 +716,52 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase
);
}
+ public function testRenderSymbolSquare()
+ {
+ $this->driver
+ ->expects( $this->once() )
+ ->method( 'drawPolygon' )
+ ->with(
+ $this->equalTo( array(
+ new ezcGraphCoordinate( 100, 100 ),
+ new ezcGraphCoordinate( 120, 100 ),
+ new ezcGraphCoordinate( 120, 120 ),
+ new ezcGraphCoordinate( 100, 120 ),
+ ) ),
+ $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ),
+ $this->equalTo( true )
+ );
+
+ $this->renderer->drawSymbol(
+ new ezcGraphBoundings( 100, 100, 120, 120 ),
+ ezcGraphColor::fromHex( '#FF0000' ),
+ ezcGraph::SQUARE
+ );
+ }
+
+ public function testRenderSymbolBox()
+ {
+ $this->driver
+ ->expects( $this->once() )
+ ->method( 'drawPolygon' )
+ ->with(
+ $this->equalTo( array(
+ new ezcGraphCoordinate( 100, 100 ),
+ new ezcGraphCoordinate( 120, 100 ),
+ new ezcGraphCoordinate( 120, 120 ),
+ new ezcGraphCoordinate( 100, 120 ),
+ ) ),
+ $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ),
+ $this->equalTo( false )
+ );
+
+ $this->renderer->drawSymbol(
+ new ezcGraphBoundings( 100, 100, 120, 120 ),
+ ezcGraphColor::fromHex( '#FF0000' ),
+ ezcGraph::BOX
+ );
+ }
+
public function testRenderFilledDataLineWithSymbolSameColor()
{
$this->driver
@@ -2200,6 +2246,26 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase
);
}
+ public function testSquareAndBoxSymbolsInChart()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $graph = new ezcGraphLineChart();
+ $graph->palette = new ezcGraphPaletteBlack();
+
+ $graph->data['sample1'] = new ezcGraphArrayDataSet( array( 1, 4, 6, 8, 2 ) );
+ $graph->data['sample1']->symbol = ezcGraph::SQUARE;
+ $graph->data['sample2'] = new ezcGraphArrayDataSet( array( 4, 6, 8, 2, 1 ) );
+ $graph->data['sample2']->symbol = ezcGraph::BOX;
+
+ $graph->render( 560, 250, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
public function testRendererOptionsPropertyMaxLabelHeight()
{
$options = new ezcGraphRendererOptions();
OpenPOWER on IntegriCloud