HI,
This test program is written in VB.Net - VS2010,
TChart - 3.5.3371.26406
When the test program is first launched, the bottom axis is in "Numeric" mode.
When the "Time" button is pressed, the bottom axis will display the current date and time, 5 minute increments, for a total of 1 hour.
However, the traces disappear.
If the "Editor" button is pressed, and the 'Data" tab is viewed, a date starting at 12/30/1899 is what is shown for the X value, which is not the value shown on the Bottom axis.
Viewing any of the data stores for any of the traces reveals similar results.
NOTE:
At this point I must alert you to an idiosyncrasy: which ever mode is selected the first time the editor is accessed, is the mode in which the editor will present its data from this point on until the program is re-started.
Viewing the Data Tab in the Editor when "Numeric" mode is selected does coincide with the bottom axis.
I'm confused by this and would like some assistance.
Thank you!
X Data in Editor not matching Bottom Axis
X Data in Editor not matching Bottom Axis
- Attachments
-
- BottomAxisTestA.Zip
- (11.65 KiB) Downloaded 776 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: X Data in Editor not matching Bottom Axis
Hello,
I obtain this:
Here we have the reason why the series disappears - the largest X Value of the first series is much smaller than the minimum value of the bottom axis. This is because the time values on the bottom axis are OLE Automation Dates, about which you can read a little here.
http://screencast.com/t/mWRBnkUhq
If I do this:tirby wrote: However, the traces disappear.
Code: Select all
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
'Time Mode
Dim aa As Integer
Dim bb As DateTime
Dim cc As DateTime
For aa = 0 To 7
TChart1.Series(aa).XValues.DateTime = True
Next aa
TChart1.Axes.Bottom.Labels.DateTimeFormat = "MM/dd/yyyy HH:mm"
TChart1.Axes.Bottom.Labels.Angle = 90
bb = Now
cc = bb.AddMinutes(60)
TChart1.Axes.Bottom.Minimum = bb.ToOADate()
TChart1.Axes.Bottom.Maximum = cc.ToOADate()
TChart1.Axes.Bottom.Increment = (TChart1.Axes.Bottom.Maximum - TChart1.Axes.Bottom.Minimum) / 12
Dim min As Double = TChart1.Axes.Bottom.Minimum
Dim first As Double = TChart1(0)(TChart1(0).Count - 1).X
MessageBox.Show("min: " + min.ToString(CultureInfo.InvariantCulture) + " last: " + first.ToString())
End Sub
Here we have the reason why the series disappears - the largest X Value of the first series is much smaller than the minimum value of the bottom axis. This is because the time values on the bottom axis are OLE Automation Dates, about which you can read a little here.
Using the latest version of TeeChart, I get the following results:tirby wrote: If the "Editor" button is pressed, and the 'Data" tab is viewed, a date starting at 12/30/1899 is what is shown for the X value, which is not the value shown on the Bottom axis.
Viewing any of the data stores for any of the traces reveals similar results.
http://screencast.com/t/mWRBnkUhq
I haven't been able to reproduce this issue here, as can be seen in the screenvideo I link to above. Could you please give me some more specific instructions on how to reproduce this issue?tirby wrote: NOTE:
At this point I must alert you to an idiosyncrasy: which ever mode is selected the first time the editor is accessed, is the mode in which the editor will present its data from this point on until the program is re-started.
Viewing the Data Tab in the Editor when "Numeric" mode is selected does coincide with the bottom axis.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: X Data in Editor not matching Bottom Axis
Actually, I have been able to reproduce this now and have added to our issue tracker with id=1378.tirby wrote:NOTE:
At this point I must alert you to an idiosyncrasy: which ever mode is selected the first time the editor is accessed, is the mode in which the editor will present its data from this point on until the program is re-started.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: X Data in Editor not matching Bottom Axis
Christopher,
Thanks for looking at this.
In testing the Time issue, I added the same lines of code you had added, and I get the same result.
I read the MS link you posted, and I now understand the why- but not how to correct it.
Can provide some guidance?
Thanks!
Thanks for looking at this.
In testing the Time issue, I added the same lines of code you had added, and I get the same result.
I read the MS link you posted, and I now understand the why- but not how to correct it.
Can provide some guidance?
Thanks!
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: X Data in Editor not matching Bottom Axis
Hello,
0 1 2 3 4 5 6 7 ...
how to convert these to DateTime values? When you convert 0, what do you want to convert it to? Do you want to convert it to today's date? Or maybe DateTime.Now? What is clear is that you will have to add new values to the series's XValues, because converting 0 to DateTime gives you a date right at the end of the nineteenth century.
I'm afraid I don't know either, as this depends on what you want to do. For example, imagine a numeric X (bottom) axis with these values:tirby wrote: In testing the Time issue, I added the same lines of code you had added, and I get the same result.
I read the MS link you posted, and I now understand the why- but not how to correct it.
0 1 2 3 4 5 6 7 ...
how to convert these to DateTime values? When you convert 0, what do you want to convert it to? Do you want to convert it to today's date? Or maybe DateTime.Now? What is clear is that you will have to add new values to the series's XValues, because converting 0 to DateTime gives you a date right at the end of the nineteenth century.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |