summaryrefslogtreecommitdiffstats
path: root/src/driver/svg.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-08-08 13:44:15 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-08-08 13:44:15 +0000
commit63b5d5f3f2dee22c890d219aeb8e4cc7fd228f41 (patch)
tree6ca08376fc8552ba6fe99f9e8a1e66b5345d33a3 /src/driver/svg.php
parent5e6c1783d9ecbbf9ae8b1e0ff8c39c0d1fb91ffa (diff)
downloadzetacomponents-graph-63b5d5f3f2dee22c890d219aeb8e4cc7fd228f41.zip
zetacomponents-graph-63b5d5f3f2dee22c890d219aeb8e4cc7fd228f41.tar.gz
- Added svg rendering options
- Made line ending style for svg configurable
Diffstat (limited to 'src/driver/svg.php')
-rw-r--r--src/driver/svg.php23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/driver/svg.php b/src/driver/svg.php
index e567188..3f4ccef 100644
--- a/src/driver/svg.php
+++ b/src/driver/svg.php
@@ -72,6 +72,9 @@ class ezcGraphSvgDriver extends ezcGraphDriver
$this->elements = $this->dom->createElement( 'g' );
$this->elements->setAttribute( 'id', 'chart' );
+ $this->elements->setAttribute( 'color-rendering', $this->options->colorRendering );
+ $this->elements->setAttribute( 'shape-rendering', $this->options->shapeRendering );
+ $this->elements->setAttribute( 'text-rendering', $this->options->textRendering );
$this->elements = $svg->appendChild( $this->elements );
}
}
@@ -122,12 +125,13 @@ class ezcGraphSvgDriver extends ezcGraphDriver
{
$path->setAttribute(
'style',
- sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f;',
+ sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f; stroke-linecap: %s;',
$color->red,
$color->green,
$color->blue,
$thickness,
- 1 - ( $color->alpha / 255 )
+ 1 - ( $color->alpha / 255 ),
+ $this->options->strokeLineCap
)
);
}
@@ -158,12 +162,13 @@ class ezcGraphSvgDriver extends ezcGraphDriver
$path->setAttribute( 'd', $pointString );
$path->setAttribute(
'style',
- sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f;',
+ sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f; stroke-linecap: %s;',
$color->red,
$color->green,
$color->blue,
$thickness,
- 1 - ( $color->alpha / 255 )
+ 1 - ( $color->alpha / 255 ),
+ $this->options->strokeLineCap
)
);
@@ -401,12 +406,13 @@ class ezcGraphSvgDriver extends ezcGraphDriver
{
$arc->setAttribute(
'style',
- sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f;',
+ sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f; stroke-linecap: %s;',
$color->red,
$color->green,
$color->blue,
1, // Line Thickness
- 1 - ( $color->alpha / 255 )
+ 1 - ( $color->alpha / 255 ),
+ $this->options->strokeLineCap
)
);
}
@@ -521,12 +527,13 @@ class ezcGraphSvgDriver extends ezcGraphDriver
{
$ellipse->setAttribute(
'style',
- sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f;',
+ sprintf( 'fill: none; stroke: #%02x%02x%02x; stroke-width: %d; stroke-opacity: %.2f; stroke-linecap: %s;',
$color->red,
$color->green,
$color->blue,
1, // Line Thickness
- 1 - ( $color->alpha / 255 )
+ 1 - ( $color->alpha / 255 ),
+ $this->options->strokeLineCap
)
);
}
OpenPOWER on IntegriCloud