Page 1 of 1
enum for styles?
Posted: Tue Apr 03, 2007 9:05 pm
I can't find an enum for Steema.TeeChart.Styles, something along the lines of LegendStyles? Could you point me in the right direction?
Posted: Wed Apr 04, 2007 8:32 am
"Steema.TeeChart.LegendStyles" has 5 options, which are: auto, LastValues, Palette, Series and Values.
You can use a Steema.TeeChart.LegendStyles as below line:
Code: Select all
tChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Auto;
Posted: Wed Apr 04, 2007 9:04 am
I just used 'LegendStyles' as an example of an enum.
I'm after something like that for the different chart styles (FastLine, Arrows etc.).
Posted: Wed Apr 04, 2007 9:17 am
Ok, then you are in the right direction, you should use, for example: Steema.TeeChart.Styles.Points, Steema.TeeChart.Styles.Line, Steema.TeeChart.Styles.FastLine, Steema.TeeChart.Styles.Arrow, Steema.TeeChart.Styles.Bar, etc.
Posted: Wed Apr 04, 2007 10:13 am
Yep, I know how to use them, we've been using them for years. The question is whether there is a enum LIKE the enum 'LegendStyles' (which contain thngs such as 'Palette', 'Series' etc.) that contain the Chart.Styles (such as 'FastLine', 'Arrow').
This is so I can write general routines and decide during run time what style I want.
Hope this clarifies my question a bit more,
Posted: Wed Apr 04, 2007 10:24 am
I'm afraid such enum doesn't exist. All series styles come from Steema.TeeChart.Styles namespace.
For palettes, for example, you can use Steema.TeeChart.Styles.PaletteStyles.GrayScale.
Please notice that in Visual Studio, when using a property, just write it down, for example: "surface1.PaletteStyle", then place the mouse over the property and a hint will appear with the type of the property.
Hope this helps!
Posted: Wed Apr 04, 2007 10:41 am
Maybe better to explain what I would like to achieve. Here is a code snippet for some imaginary situation:
dim ChrtStyle as Chart.ChrStyle
ChrtStyle = CHRTSTYLE_FastLine
Public Function SomeFun(ChrtStl as Chart.ChrStyle)
Dim serie As New ChrtStl
This can be done using a class factory approach. Maybe there is a simpler approach using TChart?
Posted: Wed Apr 04, 2007 11:34 am
Ok, now I understand what are you trying to do. This can be achieve doing something like this:
Code: Select all
private void InitializeChart()
System.Type ChrStyle = System.Type.GetType("Steema.TeeChart.Styles.FastLine,TeeChart");
private void SomeFun(System.Type ChrStyle)
Posted: Wed Apr 04, 2007 12:48 pm
Yes, that's close enough. Very good, thanks heaps for your help.
I have been using TChart for many years now and Steema Staff has been consistently extremly helpfull and knowledgable. Amazing service!
Posted: Wed Apr 04, 2007 1:36 pm
You're very welcome! I'm glad to hear that helped.
Thank you very much for your nice words.