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. enter image description here

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 .

see fiddle here

hope helps.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -