jquery - How can i add dynamic data inside flag series in highcharts -
i getting data in code chart running,i added flags max value , min value in x-axis,now want display rating inside flag.but here catagories data come rating not come on flag.here data , rating dynamically data not static. have tried on stack overflow suggestion,as including highstock.js , highcharts.js file still not working. please give me proper solution column chart.
$(document). ready(function() { var options = { chart: { renderto: 'container', type: 'column', marginright: 130, marginbottom: 50 }, title: { text: 'top 15 projects facilities rating', x: -20 //center }, subtitle: { text: '', x: -20 }, xaxis: { categories: [] }, yaxis: { title: { text: 'facilities rating' }, stacklabels: { enabled: true, style: { fontweight: 'bold', color: (highcharts.theme && highcharts.theme.textcolor) || 'gray' } }, plotlines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; } }, plotoptions:{ column: { stacking: 'normal', datalabels: { enabled: true, color:'white' } } }, legend: { layout: 'vertical', align: 'right', verticalalign: 'top', borderwidth: 0 }, series: [{ name:'rating', data:[], id:'dataseries' }, { type: 'flags', onseries: 'dataseries', data: [{ x: 0, text: 'minimum facilites rating', title: 'min' }, { x: 15, text: 'maximum facilites rating', title: 'max' }], width: 30, showinlegend: false }] } $.getjson("bargraph_data.php", function(json) { options.xaxis.categories = json[0]['data']; // options.series.splice(0,0, json[1]); options.series[0].data = json[1]['data']; chart = new highcharts.chart(options); }); });
u can check in [link]http://jsfiddle.net/sunitasingh/n3u77/3/ please give me solution how can add y-value flag series point dynamic not static.
you overwriting flags default series.. check line:
options.series[0] = json[1];
it replace flags new series. guess need prepend options, this:
options.series.splice(0, 0, json[1]);
Comments
Post a Comment