summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-08-14 14:20:39 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-08-14 14:20:39 +0000
commit58808385c0739092503c32c35e9365335040d5d0 (patch)
treed4000af4d6b27458f6df85cd41d96b887506f0a0 /src
parent07af754620fd064b0d83345f2edcc00f3afa5a98 (diff)
downloadzetacomponents-graph-58808385c0739092503c32c35e9365335040d5d0.zip
zetacomponents-graph-58808385c0739092503c32c35e9365335040d5d0.tar.gz
- Forgot to add ezcGraphInvalidDisplayTypeException
Diffstat (limited to 'src')
-rw-r--r--src/exceptions/invalid_display_type.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/exceptions/invalid_display_type.php b/src/exceptions/invalid_display_type.php
new file mode 100644
index 0000000..925c9f1
--- /dev/null
+++ b/src/exceptions/invalid_display_type.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * File containing the ezcGraphInvalidDisplayTypeException class
+ *
+ * @package Graph
+ * @version //autogen//
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+/**
+ * Exception thrown when an unsupported data type is set for the current chart.
+ *
+ * @package Graph
+ * @version //autogen//
+ */
+class ezcGraphInvalidDisplayTypeException extends ezcGraphException
+{
+ public function __construct( $type )
+ {
+ $chartTypeNames = array(
+ ezcGraph::PIE => 'Pie',
+ ezcGraph::LINE => 'Line',
+ ezcGraph::BAR => 'Bar',
+ );
+
+ if ( isset( $chartTypeNames[$type] ) )
+ {
+ $chartTypeName = $chartTypeNames[$type];
+ }
+ else
+ {
+ $chartTypeName = 'Unknown';
+ }
+
+ parent::__construct( "Invalid data set display type <$type> (<$chartTypeName>) for current chart." );
+ }
+}
+
+?>
OpenPOWER on IntegriCloud