javascript - Dynamically add xaxis to an highcharts -


i have problem highcharts add dynamically x-axis chart generated highcharts.

why want add x-axis dynamically ? because graph can have unlimited numbers of series don't regenerate completly each time add serie.

since highcharts 3.0, "we" can add dynamically x-axis chart without recreate it. here reduced test, doesn't works. add yaxis, can't found way add xaxis same function ( http://api.highcharts.com/highcharts#chart.addaxis() )

$(function() {     var chart = new highcharts.chart({         chart: {             renderto: 'container9'         },         xaxis: [{             categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']         },{},{}],         series: [{             data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]         }]     });     console.log("initial number of xaxis : " +chart.xaxis.length);     console.log("initial number of yaxis : " +chart.yaxis.length);     $('#addaxis').click(function () {         // function use : http://api.highcharts.com/highcharts#chart.addaxis()         // should works, can't found how         chart.addaxis({             categories: ['mon', 'tue', 'thi', 'fri']         },false);//try false paramater boolean true means xaxis , false means yaxis         //neither of these 2 posibilities work.         chart.addaxis({             categories: ['i', 'you', 'he', 'she', 'we', 'you', 'they']         },true);//try true paramater         console.log("number of xaxis : " + chart.xaxis.length); // nothing more         console.log("number of yaxis : " + chart.yaxis.length); // 2 more yaxis, want 1 add of xaxis         //add x-axis dynamically, it's looking for. thank in advance.      }); }); 

http://jsfiddle.net/pz4jx/3/

hope can me.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -