Circular Guage Color

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Tech44
Newbie
Newbie
Posts: 7
Joined: Wed Feb 22, 2012 12:00 am

Circular Guage Color

Post by Tech44 » Tue Apr 24, 2012 5:59 pm

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!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Circular Guage Color

Post by Sandra » Wed Apr 25, 2012 9:22 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Tech44
Newbie
Newbie
Posts: 7
Joined: Wed Feb 22, 2012 12:00 am

Re: Circular Guage Color

Post by Tech44 » Wed Apr 25, 2012 3:42 pm

Wonderful! I had to make a few changes for iOS differences but that got me exactly what I needed. Thank you!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Circular Guage Color

Post by Sandra » Thu Apr 26, 2012 9:39 am

Hello Tech44,

I am glad that my solution works for you :D

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply