Merge branch 'maint/7.0'
[ninja.git] / application / helpers / charts.php
blob109c40a3d843c1acbb85a0b9bd788031a4675387
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Charts helper class
4 */
5 class charts
7 /**
8 * Setup the mfchart library
9 */
10 public static function load($type='pie')
12 $path = Kohana::find_file('vendor','mfchart/'.ucfirst($type).'Chart');
13 if ($path !== false) {
14 require_once(dirname($path).'/Utilities.php');
15 require_once(dirname($path).'/Gradient.php');
17 require_once(dirname($path).'/Chart.php');
18 require_once(dirname($path).'/BarChart.php');
19 require_once(dirname($path).'/PieChart.php');
20 require_once(dirname($path).'/LinePointChart.php');
22 if (!defined('FONT_TAHOMA'))
23 define("FONT_TAHOMA", dirname($path).'/fonts/tahoma.ttf');
24 if (!defined("FONT_DEJAVUSANS"))
25 define("FONT_DEJAVUSANS", dirname($path).'/fonts/DejaVuSans.ttf');
26 if (!defined("FONT_DEJAVUSANS_CONDENSED"))
27 define("FONT_DEJAVUSANS_CONDENSED", dirname($path).'/fonts/DejaVuSansCondensed.ttf');
28 if (!defined("FONT_DEJAVUSERIF"))
29 define("FONT_DEJAVUSERIF", dirname($path).'/fonts/DejaVuSerif.ttf');
30 if (!defined("FONT_DEJAVUSERIF_CONDENSED"))
31 define("FONT_DEJAVUSERIF_CONDENSED", dirname($path).'/fonts/DejaVuSerifCondensed.ttf');
33 include_once( $path );
35 return $path;
37 return false;