Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zedgraph FillType.GradientByY solid

I have a horizontal bar which I want to change colour when in range, which works, however the bar has a gradient and can see how to disable the gradient and change colour.

Color[] colors = new Color[] { Color.Red, Color.Green }; 
BarItem myBar = pane1.AddBar("Null", list1Null, Color.Red);
myBar.Bar.Fill = new Fill(colors);
myBar.Bar.Fill.Type = FillType.GradientByY;

Has anyone achieved this please?

like image 210
chasher Avatar asked Dec 02 '25 20:12

chasher


1 Answers

GradientByY has this description - "Fill with a single solid color based on the Y value of the data." Before

However it has a gradient, by adding:

myBar.Bar.Fill.SecondaryValueGradientColor = Color.Empty;

It no longer has a gradient, just solid red or green, just what I wanted!

Fixed Green

like image 106
chasher Avatar answered Dec 05 '25 11:12

chasher



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!