Susanne92
Susanne92

Reputation: 217

Highchart - yAxis - 1,000 should be displayed like 1000

I can't find the settings for my problem in the Highchart API.

I've cerated an example on jsFiddle http://jsfiddle.net/qErT2/

How can I swap 1,000 into 1000 ??

Greetings

Upvotes: 2

Views: 6272

Answers (2)

AliRıza Adıyahşi
AliRıza Adıyahşi

Reputation: 15866

HighChart number format is the same like PHP NUMBER FORMATS

you can use this format any where

for tooltip

tooltip: {
    formatter: function () 
    {
        return '<b>' + this.series.name + '</b><br/>' + this.x + ' - <b>' + Highcharts.numberFormat(this.y, 0,'',''); + '</b>';
    }
}

for yAxis

yAxis: {
    labels: {
        formatter: function () {
            return Highcharts.numberFormat(this.value, 0,'','');
        }
    }
},

YOUR EXAMPLE MODIFIED DEMO (tooltip)

AND UPDATED DEMO (tooltip and yAxis labels)

Upvotes: 2

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

Take look at lang options http://api.highcharts.com/highcharts#lang and obviously you can use Highcharts.numberFormat() http://api.highcharts.com/highcharts#Highcharts.numberFormat() which can be used in tooltip formater / label formatter to display numbers as you need.

http://api.highcharts.com/highcharts#yAxis.labels.formatter

Upvotes: 1

Related Questions