user3763026
user3763026

Reputation: 83

How can I cange comma to dot on y column number format in highcharts?

How can I change comma to dot on highchart?

y column property comes with comma. But I want to change it to dot.

Here is my code:

<script>
    Highcharts.setOptions({
        lang: {
            drillUpText: '◁ {series.name}\' e Geri Dön',
            decimalPoint: '.'
        }
    });
    var options = {
        chart: {
            height: 300
        },
        title: {
            text: 'Yıllara Göre Düşük Sayıları'
        },
        xAxis: {
            categories: true
        },
        drilldown: {
            series: [{
                id: '2010',
                name: '2010',
                data: [
                    ['Apples', 4],
                    ['Pears', 6],
                    ['Oranges', 2],
                    ['Grapes', 8]
                ]
            }, {
                id: 'cars',
                name: 'Cars',
                data: [{
                    name: 'Toyota',
                    y: 4,
                    drilldown: 'toyota'
                },
                ['Volkswagen', 3],
                ['Opel', 5]
                ]
            }, {
                id: 'toyota',
                name: 'Toyota',
                data: [
                    ['RAV4', 3],
                    ['Corolla', 1],
                    ['Carina', 4],
                    ['Land Cruiser', 5]
                ]
            }]
        },
        legend: {
            enabled: false
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true
                },
                shadow: false
            },
            pie: {
                size: '80%'
            }
        },
        series: [{
            name: 'Overview',
            colorByPoint: true,
            data: [$degerToplam]
        }]
    };
    // Column chart
    options.chart.renderTo = 'container1';
    options.chart.type = 'column';
    var chart1 = new Highcharts.Chart(options);
</script>

enter image description here

Iam using it for showing to values of years. I tried

            lang: {
                drillUpText: '◁ {series.name}\' e Geri Dön',
                decimalPoint: '.'
            }

But it couldn't help me.

Upvotes: 0

Views: 667

Answers (2)

T.J. Crowder
T.J. Crowder

Reputation: 1075219

You're using decimalPoint, but what you really want is thousandsSep. Actually, you probably want both:

Highcharts.setOptions({
    lang: {
        drillUpText: '◁ {series.name}\' e Geri Dön',
        decimalPoint: ',', // <== Most locales that use `.` for thousands use `,` for decimal, but adjust if that's not true in your locale
        thousandsSep: '.'  // <== Uses `.` for thousands
    }
});

Upvotes: 2

Tobia
Tobia

Reputation: 18811

If I understand the question correctly, try this:

Highcharts.setOptions({
    lang: {
        thousandsSep: '.'
    }
});

Upvotes: 1

Related Questions