Page 1 of 1
Retrieve position of left axis
Posted: Tue Aug 23, 2011 1:55 pm
by 16657923
Hi,
- position.jpg (50.63 KiB) Viewed 6478 times
I would like to get the distance D (see my example) on a chart ?- How can I retrieve it ? D distance can change if numbers on left axis have more numbers !
Thanks for your help
Guilz
Re: Retrieve position of left axis
Posted: Wed Aug 24, 2011 10:40 am
by yeray
Hello Guilz,
D is the Left Axis Position property. You could, for example:
Code: Select all
Private Sub TChart1_OnAfterDraw()
TChart1.Canvas.Font.Size = 10
TChart1.Canvas.Font.Bold = True
TChart1.Canvas.Font.Color = vbBlue
TChart1.Canvas.TextOut TChart1.Axis.Left.Position, 100, "My label"
End Sub
Note that this property needs the chart to be drawn to have a valid value.
Re: Retrieve position of left axis
Posted: Wed Aug 24, 2011 11:19 am
by 16657923
Thank you Yeray - I was not aware that property TChart1.Axis.Left.Position could be read only after AxTChart_OnAfterDraw event
Guilz