Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Gradient brush for MinorTickmarks from 1st up to the last
posted

Hello.

Would it be possible to help me with the following question:

I would like to have  MinorTickmarks filled with gradient but in the following way: If I set gradient from Red to Green I want to see that 1-st  MinorTickmark will be filled with Red and the last within Green color.

 

At the moment I am using the following code:

radialGaugeScale1.StartAngle = 160;
            radialGaugeScale1.EndAngle = 260;

            radialGaugeScale1.MinorTickmarks.EndExtent = 79;
            radialGaugeScale1.MinorTickmarks.Frequency = 0.2;
            radialGaugeScale1.MinorTickmarks.StartExtent = 75;
            radialGaugeScale1.MinorTickmarks.StartWidth = 2;

            simpleGradientBrushElement1.EndColor = System.Drawing.Color.Red;
            simpleGradientBrushElement1.StartColor = System.Drawing.Color.DarkRed;
            radialGaugeScale1.MinorTickmarks.BrushElements.Add(simpleGradientBrushElement1);

            numericAxis1.EndValue = 3.5;
            numericAxis1.TickmarkInterval = 0.5;
            radialGaugeScale1.Axes.Add(numericAxis1);
            radialGauge1.Scales.Add(radialGaugeScale1);

 

But this code creates gradient filling within each separate MinorTickmark and all my MinorTickmarks have the same color.

Looking forward to your answer.

Regards, A__L