Miguel Flores Miguel Flores - 16 days ago 5
Javascript Question

Combine xAxis Highcharts

I have a chart from

highcharts.js
my problem is that for example... I have a line chart with 5 values (5 points) and my chart shows the xAxis like this
from value 1 to value 2: 0, 0.25, 0.5, 0.75, 1
, what I want to do is to remove
0.25, 0.5, 0.75
and keep only 0 and 1, then 1 and 2, etc... something like this:

enter image description here

How can I do that?

Here is a CodePen demo

Answer

You can control that with tickInterval:

    xAxis: {

        labels: {
            rotation: -33,
        },
      tickInterval:1
    },

http://codepen.io/bhlaird/pen/WoGmNd

http://api.highcharts.com/highcharts/xAxis.tickInterval

Comments