TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Hermes
- Newbie
- Posts: 33
- Joined: Fri Feb 03, 2012 12:00 am
Post
by Hermes » Thu Feb 23, 2012 9:19 pm
When a bar series has a point that another series on the same chart doesn't it gives an exception.
The chart is generated like this:
Code: Select all
WebChart lChart = new WebChart();
lChart.ID = "myChart";
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
((Steema.TeeChart.Styles.Bar)lChart.Chart.Series[0]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
lChart.Chart.Series[0].Add(1, 1, "lala1");
lChart.Chart.Series[0].Add(3, 2, "lala2");
lChart.Chart.Series[0].Add(6, 3, "lala3");
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
lChart.Chart.Series[1].Add(1, 2, "lala1");
//lChart.Chart.Series[1].Add(3, 4, "lala2");
lChart.Chart.Series[1].Add(6, 4, "lala2");
and gives this exception "Index was outside the bounds of the array."
Is this ok?
Thanks in advance
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Mon Feb 27, 2012 10:56 am
Hello Hermes,
I can not reproduce your problem using last version of TeeChart.Net. Can you tell us, which version are you using?
Thanks,
-
Hermes
- Newbie
- Posts: 33
- Joined: Fri Feb 03, 2012 12:00 am
Post
by Hermes » Mon Feb 27, 2012 1:21 pm
Sorry about that, the problem occurs when I save the chart to a .ten file or to a stream.
I am using 2011 4.1.2012.01030
Thanks!
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Tue Feb 28, 2012 12:59 pm
Hello Hermes,
Next code works fine for me using last version of TeeChart.Net:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
//chart
WebChart lChart = new WebChart();
lChart.ID = "myChart";
lChart.TempChart = TempChartStyle.Session;
Page.Form.Controls.Add(lChart);
MemoryStream tmpChart = new MemoryStream();
//Series
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
((Steema.TeeChart.Styles.Bar)lChart.Chart.Series[0]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
lChart.Chart.Series[0].Add(1, 1, "lala1");
lChart.Chart.Series[0].Add(3, 2, "lala2");
lChart.Chart.Series[0].Add(6, 3, "lala3");
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
lChart.Chart.Series[1].Add(1, 2, "lala1");
lChart.Chart.Series[1].Add(3, 4, "lala2");
lChart.Chart.Series[1].Add(6, 4, "lala2");
lChart.Chart.Export.Template.Save(@"C:\TChart1.ten");
//export Chart to a MemoryStream template
lChart.Chart.Export.Template.Save(tmpChart);
//save template to a Session variable
}
Can you tell us if your problem appears using previous code?
I hope will helps.
Thanks,
-
Hermes
- Newbie
- Posts: 33
- Joined: Fri Feb 03, 2012 12:00 am
Post
by Hermes » Wed Feb 29, 2012 10:39 am
The problem is that you uncommented a line that I commented on purpose to show the problem
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
//chart
WebChart lChart = new WebChart();
lChart.ID = "myChart";
lChart.TempChart = TempChartStyle.Session;
Page.Form.Controls.Add(lChart);
MemoryStream tmpChart = new MemoryStream();
//Series
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
((Steema.TeeChart.Styles.Bar)lChart.Chart.Series[0]).MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
lChart.Chart.Series[0].Add(1, 1, "lala1");
lChart.Chart.Series[0].Add(3, 2, "lala2");
lChart.Chart.Series[0].Add(6, 3, "lala3");
lChart.Chart.Series.Add(new Steema.TeeChart.Styles.Bar());
lChart.Chart.Series[1].Add(1, 2, "lala1");
// lChart.Chart.Series[1].Add(3, 4, "lala2"); /*<-- I remove this line in purpose to show what happens when a point is missing in one series */
lChart.Chart.Series[1].Add(6, 4, "lala2");
lChart.Chart.Export.Template.Save(@"C:\TChart1.ten");
//export Chart to a MemoryStream template
lChart.Chart.Export.Template.Save(tmpChart);
//save template to a Session variable
}
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Tue Mar 06, 2012 12:37 pm
Hello Hermes,
Sorry for the delay. Finally I can reproduce your problem and I have added it in bug list report with number [TF02016068]. We will try to fix it for next maintenace releases.
Thanks,
-
Hermes
- Newbie
- Posts: 33
- Joined: Fri Feb 03, 2012 12:00 am
Post
by Hermes » Wed Mar 07, 2012 10:31 am
Great! Thanks!