Obtaining X-value of left side of frame

TeeChart for ActiveX, COM and ASP
Post Reply
Chuck
Newbie
Newbie
Posts: 2
Joined: Wed May 17, 2006 12:00 am

Obtaining X-value of left side of frame

Post by Chuck » Sat Sep 02, 2006 11:55 am

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.

Chuck
Newbie
Newbie
Posts: 2
Joined: Wed May 17, 2006 12:00 am

Post by Chuck » Sat Sep 02, 2006 1:05 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 04, 2006 7:42 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply