_series,array('order()'),0); foreach ($this->_series as $axis => $datapoints) { if ($output) $output .= ','; $result['data'] = array(); foreach ($datapoints as $o) array_push($result['data'],$o->as_array()); $result['name'] = $axis; $output .= json_encode($result); } return '['.$output.']'; } public function render() { parent::render_init(); Script::add(array( 'type'=>'file', 'data'=>'media/js/highcharts-more.js', )); Script::add(array( 'type'=>'stdin', 'data'=>" $(document).ready(function() { $('#".$this->_divname."').highcharts({ chart: { type: 'bubble', height: ".$this->_height.", width: ".$this->_width.", }, title: { text: '".$this->_title."', }, subtitle: { text: '".$this->_subtitle."', }, xAxis: { title: { text: '".$this->_xmetric."' }, }, yAxis: { title: { text: '".$this->_ymetric."' }, },".($this->_tooltip ? " tooltip: { pointFormat: '".$this->_tooltip."', }," : '')." credits: { enabled: false }, plotOptions: { series: { cursor: 'pointer', point: { events: { click: function () { location.href = site_url+'".$this->_pointurl."'+this.options.id; } } } } }, series: ".$this->json().", }); });", )); return parent::render_post(); } } ?>