Hide first yaxis label

女生的网名这么多〃 提交于 2019-12-12 21:22:57

问题


I need to hide the label -200 in yaxis, is there any way to hide the first yaxis label? So the yaxis label result will be [empty] ,0, 200, 400, 600, 800


回答1:


What i did is return an empty string for negative value.

tickOptions: {
                formatter: function (format, value) {
                    if (value < 0) {
                        return ' ';
                    }
                    else {
                        return value
                    }
                }
            }



回答2:


Let say your chart is included in a div with "chart1" as id, you can hide the first yaxis label using :

$("div#chart1 div.jqplot-yaxis div.jqplot-yaxis-tick:nth-child(1)").css('display','none');

Where div#chart1 represents your chart, div.jqplot-yaxis your yaxis ticks container and jqplot-yaxis-tick:nth-child(x) the x-th ticks in this container (it goes from 1 to number of ticks - where 1 represents the ticks at the bottom of your chart)



来源:https://stackoverflow.com/questions/15802174/hide-first-yaxis-label

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