更改 zedgraph 窗格背景颜色
是否可以更改 zedgraph 窗格的背景颜色(默认为白色)?
我尝试更改 zedgraph 元素的背景颜色,但它没有给出任何可见的结果,背景仍然是白色:
ZedGraphControl.BackColor = System.Drawing.Color.Black;
并且似乎不存在 Color
或 BackColorZedGraphControl.GraphPane
上的 code> 属性。
Is it possible to change the background color (white by default) of a zedgraph pane?
I tried changing the background color of the zedgraph element, but it doesn't give any visible result, background is still white:
ZedGraphControl.BackColor = System.Drawing.Color.Black;
And there doesn't seem to exist a Color
or BackColor
property on ZedGraphControl.GraphPane
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以用来
更改[仅]图表的背景。
如果您想更改 zedgraph 中除图表之外的背景颜色,请使用
如果您想更改 zedgraph 中所有内容的背景颜色,请使用两者:
编辑:我知道您已经解决了您的问题,但我这样做了,所以如果有人搜索它,他可以很快解决他的问题:)
You can use
to change the background [only] of the chart.
If you want to change the background color the zedgraph except the chart, use
If you want to change the background color of everything in the zedgraph, use both:
EDIT: I know that you already solved your problem but I made this so if someone searches it, he can solve his problem quickly :)
myChart.GraphPane.Fill.Color = System.Drawing.Color.Black;
将创建以黑色开始的渐变填充。如果您不想使用渐变,则应该使用 -myChart.GraphPane.Chart.Fill.Brush = new System.Drawing.SolidBrush(Color.Black);
希望这能解决您的问题。
myChart.GraphPane.Fill.Color = System.Drawing.Color.Black;
will create a gradient fill started with black color. If you don't want to use gradient you should use -myChart.GraphPane.Chart.Fill.Brush = new System.Drawing.SolidBrush(Color.Black);
Hope this will solve your problem.