Hello,
I am using TeeChart Pro Activex Control v7.
I want to get the min Y axes value and maximum Y axis value displayed in the graph at the current instance.
And i want it in the up arrow or down arrow pressed event.
For example suppose i have 260000 points and if right now only 260 points are visible then i want to get the maximum visible point.
I think it could be done by implementing the scroll event
Can you please tell me which should event should be registered?
Can you please help me with an sample code in VC++.
Thanks in advance,
Scroll event implementation
Re: Scroll event implementation
Hi Roger,
If you are looking for the min and max visible Values, you could do something like following:
If you are looking for the first and last visible Indexes, change it for this:
If you are looking for the min and max visible Values, you could do something like following:
Code: Select all
Private Sub Form_Load()
TeeCommander1.ChartLink = TChart1.ChartLink
TChart1.AddSeries scPoint
TChart1.Series(0).FillSampleValues 100
TChart1.Tools.Add tcPageNumber
TChart1.Page.MaxPointsPerPage = 20
End Sub
Private Sub TChart1_OnPageChange()
TChart1.Environment.InternalRepaint
TChart1.Header.Text.Text = "Min X: " + Str$(TChart1.Series(0).MinVisibleValue(0)) + ", " + _
"Max X: " + Str$(TChart1.Series(0).MaxVisibleValue(0)) + vbNewLine + _
"Min Y: " + Str$(TChart1.Series(0).MinVisibleValue(1)) + ", " + _
"Max Y: " + Str$(TChart1.Series(0).MaxVisibleValue(1))
End Sub
Code: Select all
TChart1.Header.Text.Text = "First Index: " + Str$(TChart1.Series(0).FirstValueIndex) + ", " + _
"Last Index: " + Str$(TChart1.Series(0).LastValueIndex)
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: Scroll event implementation
Hi Yeray,
Thanks for your reply.
I tried implementing the GetFirstValueIndex() and GetLastValueIndex() but it returns -1 many times. in very rare cases it returns the values.
Is there any solution over it?
Thanks,
Thanks for your reply.
I tried implementing the GetFirstValueIndex() and GetLastValueIndex() but it returns -1 many times. in very rare cases it returns the values.
Is there any solution over it?
Thanks,
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Scroll event implementation
Hi roger,
Are you using latest v7 release available at the client area? Do you get the same using TeeChart Pro v8 ActiveX evaluation version?
Thanks in advance.
Are you using latest v7 release available at the client area? Do you get the same using TeeChart Pro v8 ActiveX evaluation version?
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 |
Re: Scroll event implementation
Hi Narcis,
I tested on ActiveXv7 and now i tried on ActiveXv8 also but it has the same issue.
The GetLastValueIndex mostly returns -1 and at some times returns 63 or 79 no other values are returned by the method.
Seems it is problematic.
Any other method which would return the maximum value displayed at current instance by the graph will also do.
Thanks,
I tested on ActiveXv7 and now i tried on ActiveXv8 also but it has the same issue.
The GetLastValueIndex mostly returns -1 and at some times returns 63 or 79 no other values are returned by the method.
Seems it is problematic.
Any other method which would return the maximum value displayed at current instance by the graph will also do.
Thanks,
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Scroll event implementation
Hi roger,
Why not using axis minimum and maximum properties then? You'll find more information about them at tutorial 4. Tutorials are available at TeeChart's program group.
Why not using axis minimum and maximum properties then? You'll find more information about them at tutorial 4. Tutorials are available at TeeChart's program group.
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 |
Re: Scroll event implementation
Hi,
Maximum and minimum returns the values of X/Y
Where as I want the maximum label in left axis. I am attaching an image where the left axis last label is rounded which must be retieved from the code
[img] [/img]
Maximum and minimum returns the values of X/Y
Where as I want the maximum label in left axis. I am attaching an image where the left axis last label is rounded which must be retieved from the code
[img] [/img]
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Scroll event implementation
Hi roger,
In that case you can use OnGetAxisLabel or OnGetNextAxisLabel event for that.
In that case you can use OnGetAxisLabel or OnGetNextAxisLabel event for that.
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 |