enum for styles?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
FrancisP
Newbie
Newbie
Posts: 15
Joined: Mon Jul 04, 2005 4:00 am

enum for styles?

Post by FrancisP » 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?

Cheers
Francis

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Wed Apr 04, 2007 8:32 am

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;
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

FrancisP
Newbie
Newbie
Posts: 15
Joined: Mon Jul 04, 2005 4:00 am

Post by FrancisP » Wed Apr 04, 2007 9:04 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 04, 2007 9:17 am

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.
Best Regards,
Narcís Calvet / 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

FrancisP
Newbie
Newbie
Posts: 15
Joined: Mon Jul 04, 2005 4:00 am

Post by FrancisP » Wed Apr 04, 2007 10:13 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 04, 2007 10:24 am

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!
Best Regards,
Narcís Calvet / 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

FrancisP
Newbie
Newbie
Posts: 15
Joined: Mon Jul 04, 2005 4:00 am

Post by FrancisP » Wed Apr 04, 2007 10:41 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 04, 2007 11:34 am

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();
}
Best Regards,
Narcís Calvet / 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

FrancisP
Newbie
Newbie
Posts: 15
Joined: Mon Jul 04, 2005 4:00 am

Post by FrancisP » Wed Apr 04, 2007 12:48 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 04, 2007 1:36 pm

Hi Francis,

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

Thank you very much for your nice words.
Best Regards,
Narcís Calvet / 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