开发者

Synchronized zooming of two TChart components

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
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜