Highcharts X-axis Equalizer starts at offset

I am trying to delete offset

by tick x-axis

.

I want the first tick to 10/8

start at the intersection of x-axis

and y-axis

.

10-8

should be on a marker that is between two marks.

I have the following code for it in highchart.

xAxis: {
            categories: categories,
            title: {
              text: title_x_axis,
              style: {
                fontWeight: 'bold'
              },
              formatter: function(){
                return "<h3><b>" + this.value + "</b></h3>";  
              }
            },
            min: 0,
            startOnTick: true,
            endOnTick: true,
            minPadding: 0,
            maxPadding: 0,
            align: "left"               
        },

      

The maximum padding and minimum padding are 0, so I don't know what the problem is?

EDIT:

I created a fiddle of the type of diagram I am dealing with. Note. The image below has different x-axis values ​​since I am not using the same script value. Also I installed tickmarkPlacement: "on"

after I took this shot. I want the label to Jan

start at the beginning of the line. It currently has some bias.

Highchart x-axis offset

Can anyone help me with this?

+3


source to share


2 answers


You can use (if "categories" is your array of categories)

 min: 0.5,
 max: categories.length-1.5,
 startOnTick: false,
 endOnTick: false,

      

Example: http://jsfiddle.net/27hg0v06/1/



Use the news version of high performance charts for a complete working tip:

<script src="http://github.highcharts.com/highcharts.js"></script>

      

+8


source


Take a look at the tickMarkPlacement property:

By default, this is "between" what you see on the chart.



Setting it to 'on' should do what you want it to do.

You can look at the minPadding and maxPadding properties in addition to the tickMarkPlacement type:

+1


source







All Articles