How to change the distance between lines of grid?

2019-08-30 00:33发布

i have

  yAxis: {

        reversed: true,
        categories: ['0','10','20','30','50','80','130','210','340','550','700'],                       
        labels: {
                    format: '{value} km',
                    enabled: true
                },
        title: {
                text: "Depth"
                }
         },

but i want to change the distance between the lines of grid (line value 0km, line value 10km ecc ecc)

Is possible ?

标签: highcharts
1条回答
姐就是有狂的资本
2楼-- · 2019-08-30 00:45

These two should work. Use the one that fits you better.

        tickPositions
        tickPositioner

Ejamples:

http://jsfiddle.net/jfbffqe7/

http://jsfiddle.net/0xb2c8e5/

Edit: This should do the trick of what you requested in the comments. http://jsfiddle.net/0xb2c8e5/1/

yAxis: {
        tickPositioner: function(){
            return[0,30, 50, 100, 250];},
        tickPixelInterval: 1},

Use tickPixelInterval with value of one, and the only return the ticks you want to see.

查看更多
登录 后发表回答