Zoom function - make it Snap to data point

Ideas and wishes for TeeChart
Post Reply
SteveP
Advanced
Posts: 132
Joined: Sun Sep 07, 2003 4:00 am

Zoom function - make it Snap to data point

Post by SteveP » Mon Nov 17, 2003 2:47 pm

Could the Zoom function be made to optionally Snap to data points like the CursorTool can and show its zooming rectangle Snapped to the nearest data point when dragging the mouse ? Perhaps the Scroll function should thus also have this property ?

David Berneda
Site Admin
Site Admin
Posts: 83
Joined: Wed Nov 12, 2003 5:00 am
Location: Girona, Catalonia
Contact:

Post by David Berneda » Wed Nov 19, 2003 4:15 pm

Thanks for your suggestion. It is already at our wish-database.

There are some issues having something like Chart1.Zoom.Snap = True.
When there are more than one series, should the snapping be done on all series or just one ? (If just one, then there must be another property to specify which series, ie: Chart1.Zoom.SnapSeries := Series 3 ).

Should snapping be done vertically, horizontally or both ?
This depends on the existing active series, if their points are sorted in the X and / or the Y direction or not. If only one direction must be considered, then the function that returns the "nearest" point to mouse XY must also take this into account.

Must be spanning done at the exact xy points location or "a little bit more" so when zooming the "snapped" points appear inside the axes limits.
Should snapping be done just when starting zooming (at the first click) or when moving the mouse?

So, all the above questions really limits or complicates having snapping as properties in Chart1.Zoom or Chart1.AllowPanning properties.

The best solution is the developer to use the Chart mouse events and customize snapping the way he / she wants.
Or, if snapping should be done only when the user releases the mouse button up, the Chart1.OnZoom event is the right place to change the desired axis min and max values to be the first and last points that "snap" to Chart1.Zoom.X and Y rectangle coordinates.

I'll prepare an example to post here in this forums or as a technical article.

regards
david

Post Reply