How can you obtain the X-value of the left side of the frame (or bottom axis) relative to the left side of the TChart control?
Need to keep a slider-like control aligned with the actual start of the plot when the size of the left axis changes.
Obtaining X-value of left side of frame
Clarification:
I originally tried to use TChart1.axis.left.position. The problem was that when I added values to the series (which changed the width of the axis labels) and immediately tested .position it did not reflect the new width.
I moved my resizing code to the AfterDraw event and all is well. Maybe there is a more straight-forward way to determine the frame position?
I originally tried to use TChart1.axis.left.position. The problem was that when I added values to the series (which changed the width of the axis labels) and immediately tested .position it did not reflect the new width.
I moved my resizing code to the AfterDraw event and all is well. Maybe there is a more straight-forward way to determine the frame position?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Chuck,
The bounding rectangle can be obtained via Axis Positions:
TChart.Axis.Left.Position,
TChart.Axis.Top.Position - TChart.Aspect.Height3D,
TChart.Axis.Right.Position + TChart.Aspect.Width3D,
TChart.Axis.Bottom.Position
If some values are still not updated you can make a call to TChart1.Environment.InternalRepaint. However be very careful where you add this because it could make your application fall into an endless loop.
The bounding rectangle can be obtained via Axis Positions:
TChart.Axis.Left.Position,
TChart.Axis.Top.Position - TChart.Aspect.Height3D,
TChart.Axis.Right.Position + TChart.Aspect.Width3D,
TChart.Axis.Bottom.Position
If some values are still not updated you can make a call to TChart1.Environment.InternalRepaint. However be very careful where you add this because it could make your application fall into an endless loop.
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 |