Jqplot show only few x axis ticks

北城余情 提交于 2019-12-02 04:33:02

I know that this is an old question but I need some solution too so here it is:
When you use jqplot to print bars you can't say it how many ticks it should print because it prints only related values so you have to print all ticks. My solution is not nice but it works. Just print ticks with empty label. For example:

axes: {
      xaxis: {
             min:1,
             max: 30,
             ticks: [[1,""],[2,""],[3,""],[4,""],[5,"5"],
                    [6,""],[7,""],[8,""],[9,""],[10,"10"],
                    [11,""],[12,""],[13,""],[14,""],[15,"15"],
                    [16,""],[17,""],[18,""],[19,""],[20,"20"],
                    [21,""],[22,""],[23,""],[24,""],[25,"25"],
                    [26,""],[27,""],[28,""],[29,""],[30,"30"]]
            }
        }

By using ticks option of axies, you can specify exactly which ticks you want to show.

Link to the doc : http://www.jqplot.com/docs/files/jqplot-core-js.html#Axis.ticks

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