某些xAxis标签未显示在Highchart:Area Chart中

时间:2016-09-22 18:06:02

标签: highcharts

我试图在图表中以高图显示6点。现在可以在图表上轻松绘制点,但缺少一些相应的x轴标签。

我希望在不增加图表宽度的情况下显示所有x轴标签。

here you can see missing x-axis labels

$('#container').highcharts({
    chart: {
        type: 'area',
        height: 200,
        width: 300
    },
    title: {
        text: ''
    },
    subtitle: {
        text: ''
    },
    credits: {
        enabled: false
    },
    xAxis: {
        allowDecimals: false,
        gridLineWidth: 0
    },
    yAxis: {
        labels: {
            enabled: false
        },
        gridLineWidth: 0,
        visible: false
    },
    legend: {
        enabled: false
    },
    plotOptions: {
        area: {
            marker: {
                enabled: true,
                symbol: 'circle',
                radius: 5,
                states: {
                    hover: {
                        enabled: true
                    }
                }
            },
            dataLabels: {
                enabled: false
            }
        }
    },
    tooltip: {

    },
    series: [{
        name: '',
        data: [1, 2, 3, 4, 5, 6]
    }]
});

这是jsfiddle link

我感谢任何帮助! :)

1 个答案:

答案 0 :(得分:1)

在xAxis中使用tickInterval属性。设置tickInterval如下

xAxis: {
   tickInterval: 1
}

此答案由上面评论部分中的@Rahul Sharma

提供
相关问题