ZedGraph MajorGrid 和 MinorGrid LineStyle [英] ZedGraph MajorGrid and MinorGrid LineStyle

查看:17
本文介绍了ZedGraph MajorGrid 和 MinorGrid LineStyle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道是否有人知道如何更改 ZedGraph 的 Major 和 Minor 网格的 LineStyle?

I just wonder if anyone knows how to change the LineStyle of the Major and Minor grid for a ZedGraph?

例如我有:

graphPane.XAxis.MinorGrid.IsVisible = true;

我想要这样的东西:

graphPane.XAxis.MinorGrid.LineStyle => solid line.

我今天做了很多研究,但找不到答案.

I've done a lot of research today but could not find the answer.

提前感谢您抽出宝贵时间.

Thank you in advance for your time.

推荐答案

如果关闭此功能,您可能已将自动缩放设置为 true,然后您可以设置您希望使用的最佳步骤,以坚持一些易于整除的数字否则你会得到一些奇怪的数字.

You probably have autoscaling set to true if you switch this off you can then set steps which you wish to use its best to stick with some numbers which are easily divisible otherwise you can get some strange numbers.

myPane.XAxis.Scale.MajorStepAuto = False
myPane.XAxis.Scale.MajorStep = 100
zg1.AxisChange()
zg1.refresh()

上面的代码完全是 x 轴,我很确定它会类似于更改 y 轴.我会从长轴开始,然后首先得到正确的,您可能会发现次要轴自动运行良好.

The above code is fully x-axis I'm fairly sure it will be similar to change the y-axis. I would start with a major axis and get the right first and you may find that the minor ones work well automatically.

下面的代码可能正在做一些与您正在寻找的非常相似的事情,并且在案例结束时我刚刚打开了 XAxis.Scale.MajorStepAuto 以防万一我们得到一些奇怪的数字

The co code below is probably doing something very similar to what you're looking for and at the end of the case I've just switched on the XAxis.Scale.MajorStepAuto just in case we get some strange number

Select Case CDbl(maxNumber)
Case Is <= 100
   myPane.XAxis.Scale.MajorStep = 10
Case Is <= 300
   myPane.XAxis.Scale.MajorStep = 25
Case Is <= 1000
   myPane.XAxis.Scale.MajorStep = 50
Case Is <= 5000
   myPane.XAxis.Scale.MajorStep = 100
Case Is <= 10000
   myPane.XAxis.Scale.MajorStep = 250
Case Is <= 50000
   myPane.XAxis.Scale.MajorStep = 1000
Case Else
   myPane.XAxis.Scale.MajorStepAuto = True
End Select

这篇关于ZedGraph MajorGrid 和 MinorGrid LineStyle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆