_autopie_columns,$column); } /** * Get our series data, and return it as a JSON array */ public function json() { $result = array(); // For our auto pie columns (on the left side), we need to build that. if (count($this->_autopie_columns) > 1) { $htpo = $this->series('pie','float'); foreach ($this->_series['yl'] as $data) $htpo->series_add($data->name(),$data->total(),array('color'=>$this->series_colour($data->index()))); $htpo->size(50); $htpo->center(50,5); } foreach ($this->_series as $axis => $values) { Sort::MASort($this->_series[$axis],array('order()'),0,FALSE); foreach ($this->_series[$axis] as $data) { array_push($result,$data->as_array(array('color'=>$this->series_colour($data->index())))); } } return json_encode($result); } public function render() { Script::add(array( 'type'=>'file', 'data'=>'media/js/highcharts.js', )); Script::add(array( 'type'=>'file', 'data'=>'media/js/modules/exporting.js', )); Script::add(array( 'type'=>'stdin', 'data'=>" $(document).ready(function() { $('#".$this->_divname."').highcharts({ chart: { height: ".$this->_height.", width: ".$this->_width.", }, title: { text: '".$this->_title."', y: 3 }, xAxis: { title: { text: 'Month' }, labels: { style: { 'font-size': '50%', 'font-weight': 'bold', }, }, ticklength: 2, categories: [] }, yAxis: { title: { text: '".$this->_ymetric."' }, labels: { formatter: function() { return this.value; } }, }, tooltip: { formatter: function() { var s; s = '' + (this.point.name ? this.point.name+': ' : '') + this.y +' ".$this->_ymetric."'; return s; } }, credits: { enabled: false }, plotOptions: { series: { stacking: 'normal' }, column: { pointPadding: 0, groupPadding: 0.1 } }, series: ".$this->json().", }); });", )); return sprintf('
',$this->_divname); } } ?>