I'm using two TChart components and would like to do synchronized zooming for them. I found that TChart has ZoomRect procedure for zooming into a desired rectangle on the chart but I haven't found any way to read the coordinates of this zoom rectangle from another chart.
开发者_开发知识库Here's some pseudo code for extra clarification:
MainChart.OnZoom := HandleZooming;
...
procedure HandleZooming(Sender: TObject);
var
zoomRectangle: TRect;
begin
zoomRectangle := MainChart.?????;
SecondaryChart.ZoomRect(zoomRectangle);
end;
I'm using Delphi XE.
This should do it:
zoomRectangle := Rect(
MainChart.Zoom.X0,
MainChart.Zoom.Y0,
MainChart.Zoom.X1,
MainChart.Zoom.Y1
);
精彩评论