We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart template programmatically

Hi,

I am using Essential Chart v5.1.

How can I save and load a template using Essential Chart control through code?

Thanks in advance.

Ramachandran

1 Reply

RF Rashidha F Syncfusion Team July 17, 2007 11:30 AM UTC

Hi Ramachandran,

Thanks for using Syncfusion Products.

If your intention is to save and load template through programmatically means, please use the following code snippet in your application.

ChartTemplate temp = new ChartTemplate(typeof(ChartControl));

//Save Template:
private void Save_Click(object sender, EventArgs e)
{
this.chartControl1.ShowContextMenu = true;
temp.Scan(chartControl1);
MemoryStream ms = new MemoryStream();
temp.Save("chart.xml");
MessageBox.Show("Saved properly");
}

//Load Template
private void Load_Click(object sender, EventArgs e)
{
temp.Apply(chartControl2);
temp.Load("chart.xml");
MessageBox.Show("Loaded properly");
}

Please refer the following sample.

http://websamples.syncfusion.com/samples/Chart.Windows/F64234/main.htm

The above sample which illustrates how to save and load template programmatically.

Please let me know if this helps.

Thanks and Regards,
Rashidha.

Loader.
Live Chat Icon For mobile
Up arrow icon