Page 1 of 1

TeeChart style determination

Posted: Tue Feb 12, 2013 4:11 pm
by 15662162
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.

Re: TeeChart style determination

Posted: Tue Feb 12, 2013 6:48 pm
by 15662162
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"
}

Re: TeeChart style determination

Posted: Wed Feb 13, 2013 2:51 pm
by 10050769
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,