Page 1 of 1
Error 'bars' not alligned with data series
Posted: Sun Jan 27, 2008 3:16 pm
by 13046874
Dear Supporter,
The error series do not line up with the data series in a stacked graph. I'm using the latest version of .Net V3.
Happy to send code if I could only find a way to attach something to this mail.
Also, I can't find method to add a value to an error style with x being a date. Does that mean that an error style can't be used for a time series?
Cheers
Francis P[/code]
Posted: Mon Jan 28, 2008 11:35 am
by narcis
Hi Francis,
Yes please, would be great if you could send us a simple example project we can run "as-is" to reproduce the problem here. You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Regarding the Error series with DateTime values, you can do something like this:
Code: Select all
Steema.TeeChart.Styles.Error error1 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
error1.XValues.DateTime = true;
error1.Add(DateTime.Parse("28/01/2008 12:33:00"), 10);
Error 'bars' not alligned with data series
Posted: Mon Jan 28, 2008 11:06 pm
by 13046874
Hi Narcis,
I sent you the code I've been using.
Thanks for your responses to my other query,
Cheers
Francis
Posted: Tue Jan 29, 2008 10:34 am
by narcis
Hi Francis,
Thanks for the information. I've been able to reproduce the issue here and added it (TF02012780) to our defect list to be fixed for future releases.
I've been able to narrow the problem. This only happens when there are multiple line an error series in the chart. Code below works fine but when uncommenting all code makes the error appear.
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim lineseries As Steema.TeeChart.Styles.Line = New Steema.TeeChart.Styles.Line(TChart1.Chart)
Dim errorseries As Steema.TeeChart.Styles.Error = New Steema.TeeChart.Styles.Error(TChart1.Chart)
'Dim lineseries2 As Steema.TeeChart.Styles.Line = New Steema.TeeChart.Styles.Line(TChart1.Chart)
'Dim errorseries2 As Steema.TeeChart.Styles.Error = New Steema.TeeChart.Styles.Error(TChart1.Chart)
ChartController1.Chart = TChart1
TChart1.Aspect.View3D = False
For x As Integer = 0 To 10
Dim y1 As Double = 10 * Math.Sin(x) + Rnd()
lineseries.Add(x, y1)
errorseries.Add(x, y1, 5 * Rnd())
'Dim y2 As Double = 100 * Rnd()
'lineseries2.Add(x, y2)
'errorseries2.Add(x, y2, 20 * Rnd())
Next
End Sub
Posted: Tue Jan 29, 2008 9:40 pm
by 13046874
Hi Narcis,
Thanks for keeping me informed.
I can add to what you found: if you have three series, the error bars of the first series will be at the left of the data point, the second will be at the correct position and the third error bars will be at the right of the data point. Hope this helps to narrow down the problem.
As this graph is quite important for my application, can you give me some indication of how long it will take to fix?
Cheers
Francis
Posted: Wed Jan 30, 2008 8:53 am
by narcis
Hi Francis,
Thanks for the information, I've been able to reproduce this here as well. I'm sorry but I can't give you an estimate date of when this will be fixed at the moment. I recommend you to be aware at this forum or subscribe to our
RSS feed for new release announcements and what's being fixed on them.
Thanks in advance.
Posted: Fri Feb 15, 2008 5:03 am
by 13046874
Hi Narcis,
coming back to the error series date problem:
the core is that the error series does not accept the following argument list
errorstyle.Add(XVal as date, YVal as double, Error as double)
Cheers
Francis
Posted: Fri Feb 15, 2008 11:27 am
by narcis
Hi Francis,
Thanks for the information. I'll add your suggestion for reviewing as well. However I reckon this is not the cause as the code below generates same chart. Internally, DateTime values are converted to double using ToOADate() as well.
Code: Select all
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Error error1 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Error error2 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
line2.Pointer.Visible = true;
error2.Color = line2.Color;
line1.Pointer.Visible = true;
error1.Color = line1.Color;
Random yVal = new Random();
for (int i = 0; i < 10; i++)
{
DateTime tmpDate = DateTime.Parse((i + 1).ToString() + "/02/2008");
double dateDouble = tmpDate.ToOADate();
line1.Add(tmpDate, yVal.Next());
error1.Add(dateDouble, yVal.Next(), yVal.Next());
line2.Add(tmpDate, yVal.Next());
error2.Add(dateDouble, yVal.Next(), yVal.Next());
}
Posted: Fri Feb 15, 2008 8:48 pm
by 13046874
Hi Narcis,
Yes, you're right, the error bar 'shifts' and the date argument are separate issues. I just could not find how to do the date-argument but it is working fine now.
Thanks for your help,
Cheers
Francis
Posted: Mon Feb 18, 2008 10:10 am
by narcis
Hi Francis,
You're welcome. I'm glad to hear that helped.
Posted: Tue Feb 19, 2008 9:48 am
by narcis
Hi Francis,
After investigating the original issue on this thread (TF02012780) we found that it is not a bug, you need to use MultiBar property, for example:
Code: Select all
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Error error1 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Error error2 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
error1.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
error2.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
line2.Pointer.Visible = true;
error2.Color = line2.Color;
line1.Pointer.Visible = true;
error1.Color = line1.Color;
Random yVal = new Random();
for (int i = 0; i < 10; i++)
{
line1.Add(i,yVal.Next());
error1.Add(i, yVal.Next(), yVal.Next());
line2.Add(i, yVal.Next());
error2.Add(i, yVal.Next(), yVal.Next());
}
Posted: Tue May 20, 2008 8:37 pm
by 13046874
Hi Narcis,
I tried your suggestion and all is working fine now with the error bars. Thanks again for your valuable help,
Cheers
Francis