diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-05-31 07:08:06 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-05-31 07:08:06 +0000 |
commit | d3c847e64379eec8e4987e5448ad8490e592f6d9 (patch) | |
tree | 02660e1d6a2644631a88259251dc1543da0e17a1 /src/interfaces | |
parent | 82208f0a38c7c4f5825bac9fc4268bdba03db5a9 (diff) | |
download | zetacomponents-graph-d3c847e64379eec8e4987e5448ad8490e592f6d9.zip zetacomponents-graph-d3c847e64379eec8e4987e5448ad8490e592f6d9.tar.gz |
- Resolved #12379: Ensure one chart can be rerendered with new datasets)
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/renderer.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/interfaces/renderer.php b/src/interfaces/renderer.php index f3408a9..85f7d66 100644 --- a/src/interfaces/renderer.php +++ b/src/interfaces/renderer.php @@ -527,6 +527,26 @@ abstract class ezcGraphRenderer abstract protected function finish(); /** + * Reset renderer properties + * + * Reset all renderer properties, which were calculated during the + * rendering process, to offer a clean environment for rerendering. + * + * @return void + */ + protected function resetRenderer() + { + $this->xAxisSpace = false; + $this->yAxisSpace = false; + + // Reset driver, maintaining its configuration + $driverClass = get_class( $this->driver ); + $driverOptions = $this->driver->options; + $this->driver = new $driverClass(); + $this->driver->options = $driverOptions; + } + + /** * Finally renders the image * * @param string $file Filename of destination file @@ -544,6 +564,8 @@ abstract class ezcGraphRenderer { $this->driver->render( $file ); } + + $this->resetRenderer(); } } ?> |