Themes and XML

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
JayG
Newbie
Newbie
Posts: 71
Joined: Mon Sep 04, 2006 12:00 am

Themes and XML

Post by JayG » Thu Sep 27, 2007 4:51 pm

TeeChart .NET v3.2.2796.22187
Visual Basic 2005 Express
Windows XP Pro SP2

Hi,

Can anyone give me info on how to use the custom themes? I want to save a custom theme based on the current chart. Later, I want to read that theme back in and apply it to a different chart. I do this:

Code: Select all

ATheme = New Steema.TeeChart.Themes.CustomTheme(TChart1.Chart)
ATheme.WriteToXML("C:\temp\atheme.xml")
The XML file is created. However, I can't figure out how to load that theme back in and apply it to a chart. I tried this:

Code: Select all

ATheme.ReadFromXML("C:\temp\atheme.xml")
Visual Basic tells me "Access of a shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated."

Jay

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

Post by Narcís » Fri Sep 28, 2007 8:16 am

Hi Jay,

You'll find an example on how to save and load custom themes at What's New?\Welcome !\New in Chart Themes\Custom Themes in the features demo, available at TeeChart's program group.
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

JayG
Newbie
Newbie
Posts: 71
Joined: Mon Sep 04, 2006 12:00 am

Themes and XML

Post by JayG » Fri Sep 28, 2007 6:35 pm

Thanks,

I was looking under "Al Features" because I thought that would include the new stuff.

Jay

JayG
Newbie
Newbie
Posts: 71
Joined: Mon Sep 04, 2006 12:00 am

Themes and XML

Post by JayG » Fri Sep 28, 2007 8:15 pm

It appears that Axis.Title.Font.Size and Axis.Title.Font.Bold are not saved as part of the theme.

Is there a way I can add these two properties (or others) to a theme?

Jay

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

Post by Narcís » Mon Oct 01, 2007 8:13 am

Hi Jay,

This works fine for me here using this code:

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			line1.FillSampleValues();
			bar1.FillSampleValues();

			tChart1.Axes.Bottom.Title.Text = "hello!";
			tChart1.Axes.Bottom.Title.Font.Size = 16;
			tChart1.Axes.Bottom.Title.Font.Bold = true;

			SaveCustomTheme();
			tChart2.Clear();
			tChart2.Import.Theme.Load(themeDirectory + "\\My Theme.xml");			
		}

		private string themeDirectory;

		private void SaveCustomTheme()
		{
			themeDirectory = Steema.TeeChart.Utils.ThemeFolder();
			tChart1.Export.Theme.SaveWithBase64 = true;
			tChart1.Export.Theme.Save(themeDirectory + "\\My Theme.xml");
		}
Could you please try if it works fine at your end?

Thanks in advance!
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