Can't get multiline property to work
Can't get multiline property to work
We are using a Line Chart, on an Access 2007 form, to plot floating-point instrument values against a common datetime bottom axis. However the bottom axis labels are not being wrapped over two lines even though the multiline property for the axis is checked.
The data is being fetched from an Access query which returns a recordset with columns as shown below:
datetime value1 value2 value3 etc
The datetime is f the format 'dd/mm/yyyy hh:mm:ss'.
Any idea why the multiline setting isnt working please ?
The data is being fetched from an Access query which returns a recordset with columns as shown below:
datetime value1 value2 value3 etc
The datetime is f the format 'dd/mm/yyyy hh:mm:ss'.
Any idea why the multiline setting isnt working please ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
Are you doing as in the example at C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\Visual Basic\Visual Basic 5 & 6\Multiline Axis Labels? Is this example working fine at your end? Which TeeChart version are you using?
Thanks in advance.
Are you doing as in the example at C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\Visual Basic\Visual Basic 5 & 6\Multiline Axis Labels? Is this example working fine at your end? Which TeeChart version are you using?
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 |
Instructions - How to post in this forum |
Yes, the example works fine on the same machine. The main differences between my project and the example are:
- My chart has multiple series sharing a common bottom axis
- The series data is from a query recordset
Just a thought - The bottom axis labels are releated to the column in the query caled 'DateTime'. There isn't any issue with reserved keywords here is there ?
- My chart has multiple series sharing a common bottom axis
- The series data is from a query recordset
Just a thought - The bottom axis labels are releated to the column in the query caled 'DateTime'. There isn't any issue with reserved keywords here is there ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
Thanks in advance.
Could you please 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.Yes, the example works fine on the same machine. The main differences between my project and the example are:
- My chart has multiple series sharing a common bottom axis
- The series data is from a query recordset
Not that I know of but there is VB/VBA reserved keyword called "DateTime" so you could try renaming this field.Just a thought - The bottom axis labels are releated to the column in the query caled 'DateTime'. There isn't any issue with reserved keywords here is there ?
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 |
Instructions - How to post in this forum |
It's difficult to produce a cut down example because the query won't work without the back end SQL Server database.
However, am I right in thinking there are two ways of producing the bottom axis labels, ie:
1) Currently I am using the following VB code to associate each point in the series with a datetime label.
me.Tchart0.Series(0).LabelsSource = "DateTime"
2) I have tried to copy the Steema example you mentioned above, ie dont use the .LabelsSource property, but instead use the following:
me.Tchart0.Axis.bottom.Increment = TChart0.GetDateTimeStep (dtOneSecond)
The mulitiline property works fine with this, but how do I set the axis labels to start at the correct time? (it currently defaults to year 1900)
However, am I right in thinking there are two ways of producing the bottom axis labels, ie:
1) Currently I am using the following VB code to associate each point in the series with a datetime label.
me.Tchart0.Series(0).LabelsSource = "DateTime"
2) I have tried to copy the Steema example you mentioned above, ie dont use the .LabelsSource property, but instead use the following:
me.Tchart0.Axis.bottom.Increment = TChart0.GetDateTimeStep (dtOneSecond)
The mulitiline property works fine with this, but how do I set the axis labels to start at the correct time? (it currently defaults to year 1900)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
http://msdn.microsoft.com/en-us/library ... adate.aspx
This is most likely because of what's described here:The mulitiline property works fine with this, but how do I set the axis labels to start at the correct time? (it currently defaults to year 1900)
http://msdn.microsoft.com/en-us/library ... adate.aspx
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
You can use SetMinMax method as shown here:
http://www.teechart.net/support/viewtopic.php?t=5657
Hope this helps!
You can use SetMinMax method as shown here:
http://www.teechart.net/support/viewtopic.php?t=5657
Hope this helps!
Best Regards,
Narcís Calvet / 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 |
OK I seem to have solved the initial multiline problem:
- I removed the following for each series -
.Labelsource = "Datetime" lines
- and added the following for each series
.XValues.Valuesource = "DateTime"
- and used the setminmax method as you suggested
However, this is now causing problems with my cursor tool:
Before the above change, the 'OnCursorToolChange' event was returning the Series array index position in the 'XVal' parameter. (eg a number 1-2000 if there are 2000 points)
Now the 'OnCursorToolChange' returns a datetime value in 'XVal'.
I was using the following line to get the Y value of a series at the cursor position:
me.txtbox.value = Tchart0.Series(0).Yvalues.Value(XVal)
This no longer works because Xval is a datetime value - any ideas please ?
- I removed the following for each series -
.Labelsource = "Datetime" lines
- and added the following for each series
.XValues.Valuesource = "DateTime"
- and used the setminmax method as you suggested
However, this is now causing problems with my cursor tool:
Before the above change, the 'OnCursorToolChange' event was returning the Series array index position in the 'XVal' parameter. (eg a number 1-2000 if there are 2000 points)
Now the 'OnCursorToolChange' returns a datetime value in 'XVal'.
I was using the following line to get the Y value of a series at the cursor position:
me.txtbox.value = Tchart0.Series(0).Yvalues.Value(XVal)
This no longer works because Xval is a datetime value - any ideas please ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
Or something like in the interpolating example here.
I'm glad to hear that.OK I seem to have solved the initial multiline problem:
Here you are mixing series x values with series value indexes and that doesn't always coincide. You should do this:Before the above change, the 'OnCursorToolChange' event was returning the Series array index position in the 'XVal' parameter. (eg a number 1-2000 if there are 2000 points)
Now the 'OnCursorToolChange' returns a datetime value in 'XVal'.
I was using the following line to get the Y value of a series at the cursor position:
me.txtbox.value = Tchart0.Series(0).Yvalues.Value(XVal)
This no longer works because Xval is a datetime value - any ideas please ?
Code: Select all
Index = Tchart0.Series(0).XValues.Locate(XVal)
If Index <> -1 Then
Tchart0.Series(0).YValues.Value (Index)
End If
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
No, the problem here is that XVal need to have exactly the same X value points have in the series otherwise Locate method doesn't find them and returns -1. In that case you'd better try using the interpolating example I pointed you in earlier posts.
Thanks in advance.
No, the problem here is that XVal need to have exactly the same X value points have in the series otherwise Locate method doesn't find them and returns -1. In that case you'd better try using the interpolating example I pointed you in earlier posts.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chints,
I'm glad to hear you could solve the problem. This is because Snap moves the cursor to exact series points.
I'm glad to hear you could solve the problem. This is because Snap moves the cursor to exact series points.
Best Regards,
Narcís Calvet / 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 |