Hello,
I am using multiple Webcharts in my web application with tempchart set to session, my question is should I have to use one GetChart.aspx file for each webchart object ? or just one GetChart.aspx for the entire app ?
I am copying and using the exact format for GetChart.aspx as specified in the tutorial.
Everytime I add a webchart to a page the previous chart gets messed up.
For example in a point series though the locations remain the same, the point labels all get messed up, the tooltip shows different labels for the points.
Any suggestions/ tips as to why this might be happening ?
Thanks
Amarsh
Multiple webcharts issue
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello Armash,
This is perfectly possible using code similar to:
There are a number of further examples of this in the ASP.NET demo shipped with TeeChart for .NET.
This is perfectly possible using code similar to:
Code: Select all
private static string hfChartId_1;
private static string hfChartId_2;
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Chart ch1 = WebChart1.Chart;
Steema.TeeChart.Chart ch2 = WebChart2.Chart;
MemoryStream tmpChart = new MemoryStream();
if (!IsPostBack)
{
hfChartId_1 = Guid.NewGuid().ToString() + "_1";
hfChartId_2 = Guid.NewGuid().ToString() + "_2";
Draw_Chart();
}
else
{
if (Session[hfChartId_1] != null)
{
tmpChart = (MemoryStream)Session[hfChartId_1];
tmpChart.Position = 0;
ch1.Import.Template.Load(hfChartId_1);
}
if (Session[hfChartId_2] != null)
{
tmpChart = (MemoryStream)Session[hfChartId_2];
tmpChart.Position = 0;
ch2.Import.Template.Load(hfChartId_2);
}
}
}
private void Draw_Chart()
{
MemoryStream tmpChart = new MemoryStream();
Steema.TeeChart.Chart ch1 = WebChart1.Chart;
Steema.TeeChart.Chart ch2 = WebChart2.Chart;
ch1.Series.Add(new Steema.TeeChart.Styles.Line());
ch2.Series.Add(new Steema.TeeChart.Styles.Bar());
ch1.Series[0].FillSampleValues();
ch2.Series[0].FillSampleValues();
ch1.Export.Template.Save(tmpChart);
Session.Add(hfChartId_1, tmpChart);
tmpChart.Position = 0;
ch2.Export.Template.Save(tmpChart);
Session.Add(hfChartId_2, tmpChart);
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/