TeeChart for ActiveX, COM and ASP
-
Kabal
- Newbie
- Posts: 19
- Joined: Mon Mar 13, 2006 12:00 am
Post
by Kabal » Fri Mar 31, 2006 4:56 am
Hello,
I want to calculate increment in the following way:
Code: Select all
With sourceChart.Axis
Dim min, max As Double
.Left.Visible = True
.Left.Automatic = True
min = .Left.Minimum
max = .Left.Maximum
.Left.Increment = (max - min) / 5
End With
but TChart show labels as as if Increment property is equal zero.
But if to set the breakpoint on line 'min = .Left.Minimum' (in VBA editor) when the Increment property is calculating correctly.
What is it and what it would be necessary to make that the increment was calculated always ?
Best regards, Rustam.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Mar 31, 2006 8:44 am
Hi Rustam,
When are you running this code? The problem may be that the original axis scales are still not calculated because the chart is not drawn yet. You could do several events combinations to achieve that but using the code below, which uses InternalRepaint to force the chart being drawn, works fine here.
Code: Select all
Private Sub Form_Load()
TChart1.Series(0).FillSampleValues 100
TChart1.Environment.InternalRepaint
With TChart1.Axis
Dim min, max As Double
.Left.Visible = True
.Left.Automatic = True
min = .Left.Minimum
max = .Left.Maximum
.Left.Increment = (max - min) / 5
End With
End Sub
-
Kabal
- Newbie
- Posts: 19
- Joined: Mon Mar 13, 2006 12:00 am
Post
by Kabal » Fri Mar 31, 2006 10:21 am
Thanks. It has helped me.