How to change the distance between lines of grid?

丶灬走出姿态 提交于 2020-01-25 17:33:30

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/28217476/how-to-change-the-distance-between-lines-of-grid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!