Page 1 of 1

Circular Guage Color

Posted: Tue Apr 24, 2012 5:59 pm
by 17261689
I am displaying multiple circular gauges on the iPad. I would like to be able to set the color of the border of the gauge (and perhaps the border width) in code to draw attention to some of the gauges. Is there a built in way to do this?

Alternatively - is there a way to change the color of the gauge itself?

Is there a way to change only the center section of the gauge?

Any example code would be most helpful.

Thanks!

Re: Circular Guage Color

Posted: Wed Apr 25, 2012 9:22 am
by 10050769
Hello Tech44,

I think you can do something as next code made it in winforms but you should be able to do the same using MonoTouch code.

Code: Select all

        private void InitializeChart()
        {
            Steema.TeeChart.Styles.CircularGauge gauge = new CircularGauge(tChart1.Chart);
            //change FaceBrush
            gauge.FaceBrush.Solid = true;
            gauge.FaceBrush.Gradient.Visible= true;
            gauge.FaceBrush.Gradient.Direction = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal;
            gauge.FaceBrush.Gradient.StartColor = Color.BlueViolet;
            gauge.FaceBrush.Gradient.MiddleColor = Color.Aqua;
            gauge.FaceBrush.Gradient.EndColor = Color.BlueViolet;
            //Change 
            gauge.Frame.OuterBand.Color = Color.GreenYellow;
            gauge.Frame.OuterBand.Gradient.Visible = false;
            gauge.Frame.MiddleBand.Color = Color.GreenYellow;
            gauge.Frame.MiddleBand.Gradient.Visible = false;
            gauge.Frame.InnerBand.Color = Color.GreenYellow;
            //Change BorderWidth
            //Outer
            gauge.Frame.FrameElementPercents[2] = 20;
            //Middle
            gauge.Frame.FrameElementPercents[1] = 75;
            //Inner
            gauge.Frame.FrameElementPercents[0] = 10;
        }
Can you tell us if previous code works as you want?

I hope will helps.

Thanks,

Re: Circular Guage Color

Posted: Wed Apr 25, 2012 3:42 pm
by 17261689
Wonderful! I had to make a few changes for iOS differences but that got me exactly what I needed. Thank you!

Re: Circular Guage Color

Posted: Thu Apr 26, 2012 9:39 am
by 10050769
Hello Tech44,

I am glad that my solution works for you :D

Thanks,