Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Highchart library series update
#1

[eluser]Unknown[/eluser]
Hi
I'm using ronan-gloo/codeigniter-highcharts-library. I want to have the ability to change series and type of higchart like in this example http://jsfiddle.net/zuXDG/

In controller i have:
Code:
function _dataInst($id_inst)
    {
                 $users=$this->functions->show_users($id_inst);
                 foreach ($users->result() as $row)  
                 {
                     $point[]=rand(1,500);
                     $data['users']['data'] = rand(100, 500);  
                     $data[$users]['name'] = $row->surname;

                 }
                $data['users']['data'] =$point;
                $data['axis']['categories']=$users;
                $data['axis']['labels']=array('rotation'=>-45);
        return $data;
    }

private function getChartInst($id_inst) {
             $graph_data = $this->_dataInst($id_inst);    
                $this->highcharts->set_type('column');
                $this->highcharts->set_title('Title', 'Subtitle');
                $this->highcharts->set_xAxis($graph_data['axis']);  
                $this->highcharts->set_serie($graph_data['users']);
                $this->highcharts->render_to("chart");
                return $data['chartsInst'] = $this->highcharts->render();
        }
my view:
Code:
<?php if(isset($chartsInst)) echo $chartsInst;  ?>
What should I add to have possibilities to dynamically change series and type of chart

Greatly appreciate any help!
#2

[eluser]treenef[/eluser]
This is really a jquery issue rather than codeigniter. The author use onchange to load different charts.




Theme © iAndrew 2016 - Forum software by © MyBB