Page 1 of 1

enum for styles?

Posted: Tue Apr 03, 2007 9:05 pm
by 9637610
I can't find an enum for Steema.TeeChart.Styles, something along the lines of LegendStyles? Could you point me in the right direction?

Cheers
Francis

Posted: Wed Apr 04, 2007 8:32 am
by 9348258
Hi Francis

"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
by 9637610
Hi Edu,
I just used 'LegendStyles' as an example of an enum.
I'm after something like that for the different chart styles (FastLine, Arrows etc.).
Thanks,
Francis

Posted: Wed Apr 04, 2007 9:17 am
by narcis
Hi Francis,

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
by 9637610
Hi Narcis,
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,
Cheers
Francis

Posted: Wed Apr 04, 2007 10:24 am
by narcis
Hi Francis,

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
by 9637610
Hi Narcis,
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
SomeFun(ChrtStyle )
........

Public Function SomeFun(ChrtStl as Chart.ChrStyle)
Dim serie As New ChrtStl
....
end function

This can be done using a class factory approach. Maybe there is a simpler approach using TChart?

Thanks
Francis

Posted: Wed Apr 04, 2007 11:34 am
by narcis
Hi FrancisP,

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");
SomeFun(ChrStyle);
}

private void SomeFun(System.Type ChrStyle)
{
tChart1.Series.Add(ChrStyle);
tChart1[0].FillSampleValues();
}

Posted: Wed Apr 04, 2007 12:48 pm
by 9637610
Hi Narcis
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!
Thanks again,
Cheers
Francis

Posted: Wed Apr 04, 2007 1:36 pm
by narcis
Hi Francis,

You're very welcome! I'm glad to hear that helped.

Thank you very much for your nice words.