Support Incident Tracker GIT4.x
chart.php File Reference

Go to the source code of this file.

Functions

 __autoload ($name)

Variables

if(!extension_loaded('gd'))
trigger_error(" requires the
gd 
module
if(!extension_loaded('gd'))
trigger_error(" requires the
gd 
E_USER_ERROR
 $type = clean_fixed_list($_REQUEST['type'], array('pie','line','bar'))
 $data = explode('|',cleanvar($_REQUEST['data']))
 $legends = explode('|', cleanvar($_REQUEST['legends'], TRUE, FALSE, FALSE))
 $title = urldecode(cleanvar($_REQUEST['title']))
 $unit = cleanvar($_REQUEST['unit'])
 $chart = new $CONFIG['default_chart'](500, 150)

Function Documentation

__autoload ( name)

Definition at line 29 of file chart.php.

{
    $name = strtolower($name);
    $locations = array(APPLICATION_LIBPATH . "chart_{$name}.class.php",
                        APPLICATION_PLUGINPATH . $name . DIRECTORY_SEPARATOR . "chart_{$name}.class.php",
                        APPLICATION_PLUGINPATH . $name . DIRECTORY_SEPARATOR . "{$name}.class.php");
                        
    foreach ($locations AS $l)
    {
        if (file_exists($l))
        {
            require_once ($l);
            return true;
        }
    }
    
    return false;
}

debug_log("Charting library being used is {$CONFIG['default_chart']}");

$chart = new $CONFIG['default_chart'](500, 150);
$chart->setTitle($title);
$chart->setData($data);
$chart->setLegends($legends);
$chart->setUnit($unit);

switch ($type)
{
    case 'pie':
        $chart->draw_pie_chart();
        break;
    case 'line':
        $chart->draw_line_chart();
        break;
    case 'bar':
        $chart->draw_bar_chart();
       break;
    default:
        $chart->draw_error();
}

Variable Documentation

$chart = new $CONFIG['default_chart'](500, 150)

Definition at line 50 of file chart.php.

$legends = explode('|', cleanvar($_REQUEST['legends'], TRUE, FALSE, FALSE))

Definition at line 25 of file chart.php.

$title = urldecode(cleanvar($_REQUEST['title']))

Definition at line 26 of file chart.php.

$type = clean_fixed_list($_REQUEST['type'], array('pie','line','bar'))

Definition at line 23 of file chart.php.

$unit = cleanvar($_REQUEST['unit'])

Definition at line 27 of file chart.php.

if (!extension_loaded('gd')) trigger_error(" requires the gd module

Definition at line 20 of file chart.php.