Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to remove the offset on the tick of the x-axis.

I want the first tick 10/8 to start from the x-axis and y-axis intersection.

10-8 should be on the marker which is between the two labels.

I have 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"               
        },

Max padding and min padding are set to 0, So I don't know what the problem is?

EDIT:

I have created a fiddle of the type of chart I am dealing with. Note Image below has different x-axis values as I am not using the same value of fiddle. Also I have set tickmarkPlacement: "on" after I took that snapshot. I want Jan label to start from the beginning of line. It has some offset currently.

Highchart x-axis offset

Can anyone help me with this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
315 views
Welcome To Ask or Share your Answers For Others

1 Answer

You could use (assuming '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 newset version of highcharts to get fully working tooltip:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

Just Browsing Browsing

[3] html - How to create even cell spacing within a

548k questions

547k answers

4 comments

86.3k users

...