javascript jQPlot - 删除垂直网格线

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10126889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 08:46:02  来源:igfitidea点击:

jQPlot - remove vertical grid lines

javascriptjquerychartsjqplot

提问by nolt2232

I am using jqPlot as my charting framework and have numerous charts in my application, primarily line and stacked bar charts.

我使用 jqPlot 作为我的图表框架,并且在我的应用程序中有许多图表,主要是折线图和堆积条形图。

I now have a requirement to only show the horizonal grid lines on these charts and do not see any options in jqPlot to do this.

我现在要求只在这些图表上显示水平网格线,并且在 jqPlot 中看不到任何选项来执行此操作。

There is a showGridlineoption but that disables the grid lines entirely.

有一个showGridline选项,但可以完全禁用网格线。

Is it possible to remove only the vertical grid lines in jqPlot and continue to show the horizontal ones?

是否可以只删除 jqPlot 中的垂直网格线并继续显示水平网格线?

回答by nolt2232

I figured it out. You can apply showGridlineto a single axis by doing the following:

我想到了。您可以showGridline通过执行以下操作来应用到单个轴:

axes:{
    xaxis: {
       tickOptions:{
          showGridline: false
       }
    }
}

回答by Varun Naharia

To remove the grid line on the X-axis :

要删除 X 轴上的网格线:

axes : {
    xaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

To remove the grid line on the Y-axis :

要删除 Y 轴上的网格线:

axes : {
    yaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

To remove the grid line on both axes :

要删除两个轴上的网格线:

axes : {
    xaxis : {
       tickOptions : {
           showGridline : false
       }
    },
    yaxis : {
       tickOptions : {
           showGridline : false
       }
    }
}

or

或者

grid : {
    drawGridlines: false
}