TeeChart style determination

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

TeeChart style determination

Post by Pete » Tue Feb 12, 2013 4:11 pm

i have 2 charts on a panel. one is a regular cartesian chart (typical X/Y axes), the other is a polar chart. i'm writing a common function to reset the charts by using the double-click event handler. one of the parameters on the event handler is sender. if i cast this like this ... Steema.TeeChart.TChart tTempChart = sender as Steema.TeeChart.TChart, i do get the "pointer" to the correct chart.

at the moment, i can check the max x value to see if it's 360 ... Math.Round(tTempChart[0].MaxXValue()==360 ... but i'd like to be able to check a parameter to see if the chart style is Polar or Cartesian. how can i do this?

thanks,

pete.

Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

Re: TeeChart style determination

Post by Pete » Tue Feb 12, 2013 6:48 pm

after a lot of interactive "immediate window" queries, i think i may have answered my own question.

if (tTempChart[0].GetType().Name=="PolarBar")
{
// this is a polar chart
}
else
{
// this is a cartesian chart ... GetType().Name equals "Points"
}

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

Re: TeeChart style determination

Post by Sandra » Wed Feb 13, 2013 2:51 pm

Hello Pete,
GetType. Name is a valid solution to check which series are you using. Other option as you can use is work directly with type of Series as do in next line of code:

Code: Select all

 if (tChart1[0] is Steema.TeeChart.WPF.Styles.PolarBar)
                {

                }
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

Post Reply