Error 'bars' not alligned with data series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Error 'bars' not alligned with data series

Post by FP_Oz » Sun Jan 27, 2008 3:16 pm

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]

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jan 28, 2008 11:35 am

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);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Error 'bars' not alligned with data series

Post by FP_Oz » Mon Jan 28, 2008 11:06 pm

Hi Narcis,
I sent you the code I've been using.
Thanks for your responses to my other query,
Cheers
Francis

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 29, 2008 10:34 am

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Post by FP_Oz » Tue Jan 29, 2008 9:40 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jan 30, 2008 8:53 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Post by FP_Oz » Fri Feb 15, 2008 5:03 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 15, 2008 11:27 am

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());
			}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Post by FP_Oz » Fri Feb 15, 2008 8:48 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 18, 2008 10:10 am

Hi Francis,

You're welcome. I'm glad to hear that helped.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 19, 2008 9:48 am

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());
			}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Post by FP_Oz » Tue May 20, 2008 8:37 pm

Hi Narcis,
I tried your suggestion and all is working fine now with the error bars. Thanks again for your valuable help,
Cheers
Francis

Post Reply