summaryrefslogtreecommitdiffstats
path: root/src/exceptions/invalid_display_type.php
blob: 925c9f17a5a4b8e665fa6cb8f336363c6f874f27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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