Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

TChart: resetting zoom without adjusting axis position?

delphi tchart

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 AlecR

AlecR

    CC Lurker

  • New Member
  • Pip
  • 4 posts

Posted 07 January 2015 - 01:35 PM

TChart has a build in function, UndoZoom, which resets the zoom of the graph to its original value.

 

Whilst this is very useful, it also resets the graph so the minimum and maximum axes values (the bottom and left axes in my case) are displayed.

 

The reason this is a problem is I have graph scrolling enabled, so I want the user to be able to scroll and then reset the zoom, without where they have scrolled to being affected.

 

Here's my procedure:

procedure ResetZoomClick(Sender: TObject);
 begin
  chtGraph.UndoZoom;
 end;

As you can see it's very barebones as the function takes care of most of the work! :P

 

How would I go about modifying it to do the above?



#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 07 January 2015 - 11:23 PM

I am a little lost, doesn't zoom apply to a rectangle inside the graphic, and not necessarily to the whole image?

As I recall, Zoom doesn't need to be modal, you could scroll with no problem.

 

Or are you saying that you want to zoom the whole image? and the problem being you didn't resize the image so it doesn't scroll the whole zoom?