Frage

I have this gauge here and can't figure out how to round the decimals on the round label to one. enter image description here

tried this:

    title: {
        text: when,
        style: {
            fontSize: fontSizeMin + 4 + 'px'
        },
        formatter: function () {
            Math.round(this.y * Math.pow(10, 1)) / Math.pow(10, 1); 
        }
    },

but didn't work...

War es hilfreich?

Lösung

Use this:

 Highcharts.numberFormat(this.y,0)

Example: http://jsfiddle.net/CAKQH/24227/

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top