TChart.Page.Next Problem
TChart.Page.Next Problem
Dear Sir
TChart.Page.Next not working when TChart contain single series and MaxPointsPerPage = 1.
My TChart version is TeeChart Pro AX v6.0.1.1
Thank
Eric
TChart.Page.Next not working when TChart contain single series and MaxPointsPerPage = 1.
My TChart version is TeeChart Pro AX v6.0.1.1
Thank
Eric
Hi Eric,
yes, you're correct, this bug has been fixed in the TeeChart Pro v7. As a workaround for the v6 would be to set the axis scales manually according the point that must be displayed.
yes, you're correct, this bug has been fixed in the TeeChart Pro v7. As a workaround for the v6 would be to set the axis scales manually according the point that must be displayed.
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Dear Eric,
Please read Tutorial 4 - Axis Control for information on how to do that. You'll find the tutorials at TeeChart's program group.
Please read Tutorial 4 - Axis Control for information on how to do that. You'll find the tutorials 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Dear Eric,
You should use SetMinMax method, for example:
Or do what's told in the Setting axis scales by code in the tutorial.
You should use SetMinMax method, for example:
Code: Select all
TChart1.Axis.Bottom.SetMinMax 0, 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 |
Instructions - How to post in this forum |
Dear Sir
Below the code also cannot draw the chart nicely.
Can you please give me a correct workaround vb6 code?
This is third time i asking.
TChart1.Axis.Bottom.SetMinMax 0, 10
AND
Setting axis scales by code
You can change the Maximum and Minimum at runtime using this code:
With TChart1.Axis.Bottom
.Automatic = False
.Maximum = 36
.Minimum = 5
End With
You may set Axis scale Maximum and Minimum to automatic individually. e.g:
With TChart1.Axis.Bottom
.AutomaticMaximum = True
.AutomaticMinimum = False
.Minimum = 5
End With
Below the code also cannot draw the chart nicely.
Can you please give me a correct workaround vb6 code?
This is third time i asking.
TChart1.Axis.Bottom.SetMinMax 0, 10
AND
Setting axis scales by code
You can change the Maximum and Minimum at runtime using this code:
With TChart1.Axis.Bottom
.Automatic = False
.Maximum = 36
.Minimum = 5
End With
You may set Axis scale Maximum and Minimum to automatic individually. e.g:
With TChart1.Axis.Bottom
.AutomaticMaximum = True
.AutomaticMinimum = False
.Minimum = 5
End With
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Eric,
Which is the exact problem you are having using this?Below the code also cannot draw the chart nicely.
Try doing something like this:Can you please give me a correct workaround vb6 code?
Code: Select all
Dim Page As Integer
Private Sub Command1_Click()
With TChart1
.Axis.Bottom.SetMinMax .Series(0).XValues.Value(0), .Series(0).XValues.Value(.Page.MaxPointsPerPage - 1)
Page = 1
End With
End Sub
Private Sub Command2_Click()
With TChart1
If Page > 1 Then
Page = Page - 1
.Axis.Bottom.SetMinMax .Series(0).XValues.Value(.Page.MaxPointsPerPage * (Page - 1)), .Series(0).XValues.Value((.Page.MaxPointsPerPage * (Page - 1)) + .Page.MaxPointsPerPage - 1)
End If
End With
End Sub
Private Sub Command3_Click()
With TChart1
If Page < .Page.Count Then
.Axis.Bottom.SetMinMax .Series(0).XValues.Value(.Page.MaxPointsPerPage * Page), .Series(0).XValues.Value((.Page.MaxPointsPerPage * Page) + .Page.MaxPointsPerPage - 1)
Page = Page + 1
End If
End With
End Sub
Private Sub Command4_Click()
With TChart1
.Axis.Bottom.SetMinMax .Series(0).XValues.Value(.Series(0).Count - .Page.MaxPointsPerPage), .Series(0).XValues.Value(.Series(0).Count - 1)
Page = .Page.Count
End With
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scBar
.Page.MaxPointsPerPage = 5
Page = 1
.Series(0).FillSampleValues 20
End With
End Sub
Private Sub TChart1_OnAfterDraw()
TChart1.Axis.Bottom.MinimumOffset = 50
TChart1.Axis.Bottom.MaximumOffset = 50
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 |
Instructions - How to post in this forum |
Dear Sir
I think we have some miss understanding. Try to run below the code and click next and back buttom. The Tchart not draw the series but legend will do. I just want some workaround vb6 code to solved this problem.
Private Sub Next_Click()
TChart1.Page.Next
End Sub
Private Sub Back_Click()
TChart1.Page.Previous
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scBar
.Page.MaxPointsPerPage = 1
Page = 1
.Series(0).FillSampleValues 20
End With
End Sub
Eric
I think we have some miss understanding. Try to run below the code and click next and back buttom. The Tchart not draw the series but legend will do. I just want some workaround vb6 code to solved this problem.
Private Sub Next_Click()
TChart1.Page.Next
End Sub
Private Sub Back_Click()
TChart1.Page.Previous
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scBar
.Page.MaxPointsPerPage = 1
Page = 1
.Series(0).FillSampleValues 20
End With
End Sub
Eric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Dear Eric,
Sorry if I my explanation was not complete. As my colleague Pep told you, in v6 those functions are not working fine. As he suggested a workaround is manually setting axes scales as I did in my example. What I forgot to tell you is why each button is used for. Command1 moves to the first page, Command2 moves the chart to the previous page, Command3 moves the chart to the next page and Command4 moves the chart to the last page. Could you please try this and let us know if it's what are you looking for?
Thanks in advance.
Sorry if I my explanation was not complete. As my colleague Pep told you, in v6 those functions are not working fine. As he suggested a workaround is manually setting axes scales as I did in my example. What I forgot to tell you is why each button is used for. Command1 moves to the first page, Command2 moves the chart to the previous page, Command3 moves the chart to the next page and Command4 moves the chart to the last page. Could you please try this and let us know if it's what are you looking for?
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 Eric,
Try playing a little fit with bottom axis offsets in the OnAfterDraw event. It works fine for me here using this:
Try playing a little fit with bottom axis offsets in the OnAfterDraw event. It works fine for me here using this:
Code: Select all
Private Sub TChart1_OnAfterDraw()
TChart1.Axis.Bottom.MinimumOffset = 200
TChart1.Axis.Bottom.MaximumOffset = 200
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 |
Instructions - How to post in this forum |