1 | <?php |
---|
2 | /** |
---|
3 | * pChart.class.php |
---|
4 | * @filesource |
---|
5 | */ |
---|
6 | // Require core pCHart class |
---|
7 | require_once(sfConfig::get('sf_xspchart_lib_dir') . '/pChart/pChart.class' ); |
---|
8 | require_once(sfConfig::get('sf_xspchart_lib_dir') . '/pChart/pData.class' ); |
---|
9 | require_once(sfConfig::get('sf_xspchart_lib_dir') . '/pChart/pCache.class' ); |
---|
10 | |
---|
11 | // Load helper |
---|
12 | sfApplicationConfiguration::getActive()->loadHelpers('xsPChart'); |
---|
13 | |
---|
14 | /** |
---|
15 | * xsPChart |
---|
16 | * |
---|
17 | * Additional methods |
---|
18 | * - xsSetFontProperties('font_name', ...) -> wrapper for setFontProperties() with automatic path to 'Fonts' dir |
---|
19 | * - xsRender() -> wrapper for Render() with automatic path to 'xspchart_web_tmp_dir' |
---|
20 | * |
---|
21 | * @author Michał Organek / XSolve |
---|
22 | * @version 2009-02-06 |
---|
23 | * @package symfony |
---|
24 | * @subpackage xsPChart |
---|
25 | * @link http://pchart.sourceforge.net/documentation.php |
---|
26 | * @example |
---|
27 | */ |
---|
28 | class xsPChart extends pChart |
---|
29 | { |
---|
30 | |
---|
31 | |
---|
32 | /** |
---|
33 | * Clear content of temporary directory or just sinle file |
---|
34 | * |
---|
35 | * @author orj |
---|
36 | * @version 2009-02-09 |
---|
37 | */ |
---|
38 | public function xsClearTmpDir($fileName = null) |
---|
39 | { |
---|
40 | if(!is_null($fileName)) |
---|
41 | { |
---|
42 | @unlink(sfConfig::get('sf_web_dir') . sfConfig::get('xspchart_web_tmp_dir') . DIRECTORY_SEPARATOR . $fileName ); |
---|
43 | } |
---|
44 | else |
---|
45 | { |
---|
46 | sfToolkit::clearDirectory(sfConfig::get('sf_web_dir') . sfConfig::get('xspchart_web_tmp_dir')); |
---|
47 | } |
---|
48 | |
---|
49 | } // xsClearTmpDir() |
---|
50 | |
---|
51 | /** |
---|
52 | * xsSetFontProperties |
---|
53 | *~ |
---|
54 | * @author orj |
---|
55 | * @version 2009-02-09 |
---|
56 | */ |
---|
57 | public function xsSetFontProperties() |
---|
58 | { |
---|
59 | $params = func_get_args(); |
---|
60 | $params[0] = sfConfig::get('sf_xspchart_lib_dir') . DIRECTORY_SEPARATOR . 'Fonts' . DIRECTORY_SEPARATOR . $params[0]; |
---|
61 | |
---|
62 | call_user_func_array(array($this, 'parent::setFontProperties'), $params); |
---|
63 | } // xsSetFontProperties() |
---|
64 | |
---|
65 | /** |
---|
66 | * xsRender |
---|
67 | * |
---|
68 | * @author orj |
---|
69 | * @version 2009-02-09 |
---|
70 | */ |
---|
71 | public function xsRender($fileName) |
---|
72 | { |
---|
73 | parent::Render(sfConfig::get('sf_web_dir') . sfConfig::get('sf_xspchart_web_tmp_dir') . DIRECTORY_SEPARATOR . $fileName); |
---|
74 | } // xsRender() |
---|
75 | |
---|
76 | /** |
---|
77 | * xsStroke |
---|
78 | * |
---|
79 | * @author roux |
---|
80 | * @version 2010-09-26 |
---|
81 | */ |
---|
82 | public function xsStroke() |
---|
83 | { |
---|
84 | if ( $this->ErrorReporting ) |
---|
85 | $this->printErrors("GD"); |
---|
86 | |
---|
87 | /* Save image map if requested */ |
---|
88 | if ( $this->BuildMap ) |
---|
89 | $this->SaveImageMap(); |
---|
90 | imagepng($this->Picture); |
---|
91 | } // xsStroke() |
---|
92 | |
---|
93 | } |
---|
94 | // pChart |
---|
95 | |
---|
96 | /** |
---|
97 | * xsPData |
---|
98 | * |
---|
99 | * @author Michał Organek / XSolve |
---|
100 | * @version 2009-02-06 |
---|
101 | * @package symfony |
---|
102 | * @subpackage xsPData |
---|
103 | */ |
---|
104 | class xsPData extends pData |
---|
105 | { |
---|
106 | |
---|
107 | } // pChart |
---|
108 | |
---|
109 | /** |
---|
110 | * xsPData |
---|
111 | * |
---|
112 | * @author Michał Organek / XSolve |
---|
113 | * @version 2009-02-06 |
---|
114 | * @package symfony |
---|
115 | * @subpackage xsPData |
---|
116 | */ |
---|
117 | class xsPCache extends pData |
---|
118 | { |
---|
119 | |
---|
120 | } // pChart |
---|
121 | |
---|
122 | |
---|
123 | ?> |
---|