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
.
myChart.GraphPane.Chart.Fill.Color = System.Drawing.Color.Black;
You can use
zg.GraphPane.Chart.Fill.Color = SystemColors.ControlText;
to change the background [only] of the chart. If you want to change the background color the zedgraph except the chart, use
zg.GraphPane.Fill.Color = SystemColors.ControlText;
If you want to change the background color of everything in the zedgraph, use both:
zg.GraphPane.Chart.Fill.Color = SystemColors.ControlText;
zg.GraphPane.Fill.Color = SystemColors.ControlText;
EDIT: I know that you already solved your problem but I made this so if someone searches it, he can solve his problem quickly :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With