如何更改高图中的标签双数

How to change label double number in highchart

我在使用 highchart 时遇到问题,因为我只想要 普通数字 (1,2,3,4 更多)而不是 双数字(还有1,1,2,2,3,3),如何解决这个问题??

我已经在这个网站上尝试了格式标签 http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting

谢谢

这是我的截图

这是我的代码

<script>
$(function () {
    $('#chart2').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: 'Kunjungan Pasien Dan Dokter / Hari'
        },
        yAxis: {
            min: 0,
             labels: {
            format: '{value:.y:,.0f}'
            },
            title: {
                text: 'Kunjungan / Hari'
            }
        },
        tooltip: {
            headerFormat: '<table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y} Kunjungan</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true,
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },

        series: [{
            name: 'Kunjugan Pasien',
            data: [2]

        }, {
            name: 'Kunjungan Dokter',
            data: [2]

        }]
    });
});
</script>

帮帮我。谢谢 :)

您可以使用 yAxis.tickInterval (API) 并将其设置为 1 以获取从 0、1、2...

的所有数字

例如,在我们的代码中您需要:

yAxis: {
    tickInterval: 1
}

this updated JSFiddle demonstration