javascript - How to change the legend data highcharts -
is there way have alternate data in legend of pie chart using highcharts? instead of point data, want displays small snippet of info pertaining graph.
i added labelformatter changes values each data point. need appear once.
legend: { layout: 'vertical', floating: true, verticlalalign: 'bottom', align: 'left', usehtml: true, enabled: true, bordercolor: '#909090', title: { text:'output (mw)', style: { fontweight: 'bold', fontsize: '12px', textalign: 'center' }, } }
i suggest iterate on legend items. can done using label formatter function of legends below :
labelformatter: function () { if (this._i%2 === 0) {return null; } else {return this.name; } }
i seen , highcharts legend retuns _i order of legends . put condition there check if rutun null else return legend's label .
hope helps.
Comments
Post a Comment