How to add units to Highcharts/Highmaps's last legend/coloraxis? -


i'd add units legend/coloraxis of heatmap. work piece of code:

    coloraxis:      {         stops: [         [0, '#c4463a'],         [0.7, '#fffbbc'],         [1, '#3060cf']         ],         labels:          {             formatter: function ()              {                 return this.value + "km2";             }         }     }  

but put me "km2" @ each of numbers in legend/coloraxis. however, not sufficient, surely more clean, put once, @ end of last number. legend read:

-4000, -2000, 0, 2000 km2

is possible within highcharts/highmaps put unit @ last coloraxis lable? otherwise, need put text item there specifying x/y coordinates, no?

here fiddle.

thanks hints.

use following code :

 labels: {             formatter: function () {                if(this.islast)                 return this.value+"km2";                 else                      return this.value;             }         } 

here is updated fiddle


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 -