Page 1 of 1
Stacked Bars with "non-complete" series
Posted: Thu Feb 23, 2012 9:19 pm
by 15661479
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
Re: Stacked Bars with "non-complete" series
Posted: Mon Feb 27, 2012 10:56 am
by 10050769
Hello Hermes,
I can not reproduce your problem using last version of TeeChart.Net. Can you tell us, which version are you using?
Thanks,
Re: Stacked Bars with "non-complete" series
Posted: Mon Feb 27, 2012 1:21 pm
by 15661479
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!
Re: Stacked Bars with "non-complete" series
Posted: Tue Feb 28, 2012 12:59 pm
by 10050769
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,
Re: Stacked Bars with "non-complete" series
Posted: Wed Feb 29, 2012 10:39 am
by 15661479
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
}
Re: Stacked Bars with "non-complete" series
Posted: Tue Mar 06, 2012 12:37 pm
by 10050769
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,
Re: Stacked Bars with "non-complete" series
Posted: Wed Mar 07, 2012 10:31 am
by 15661479
Great! Thanks!