我的xAxis标签有什么不对齐的?

时间:2013-08-28 21:08:54

标签: highcharts

我是高级图表的新手,我只是想尝试获得一个基本的折线图。当我设置xaxis标签步骤时,我的标签变得不对齐。我正在使用v3.0.5。 JSFiddle example任何人都知道为什么?

enter image description here

 $(elementSelector).highcharts({
    title:{
        text:''
    },
    tooltip: {
        enabled:false  
    },
    chart: {
        type: chartType
    },
    xAxis: {
        title: {
            text: sectionData.XAxisLabel
        },
        labels: {
            step: sectionData.XAxisLabelSkip
        },
        categories: xpoints 
    },
    yAxis: {
        title: {
            text: sectionData.YAxisLabel
        },
        min: 0,
    },
    plotOptions: {
        line: {
            dataLabels: {
                enabled: true
            }
        }
    },
    series: [{
        title:'',
        data: ypoints,
        showInLegend: false
    }]
});

1 个答案:

答案 0 :(得分:2)

我建议删除数组中的“2013”​​元素并使用tickInterval而不是step。

tickInterval:4,

http://jsfiddle.net/rtFy9/1/