techy2 commented on PR #20829:
URL: https://github.com/apache/echarts/pull/20829#issuecomment-2735506603

   anchor:  is an optional parameter that only applies to 'inside' zooming, if 
it put in 'option' it has no affect
   the default behavior of dataZoom with the mouse wheel is : zoom in, move 
both edges of the data outwards towards the start and end points of the visible 
window, and move mored data into the window from the start and endpoints of the 
visible window.
   
   anchor: changes that behavior so that if the anchor says
   anchor: 'end',    then that end will not move, only the start of the data 
will zoom in and out of the chart view window
   
   anchor: 'start'    pins the oldest data so that only the newest data zooms 
in and out of the view window.
   
   why is this useful. For financial charts that track information over time, 
(think of stock trading or monthly revenue) the users typically wants to zoom 
in on the most recent data. pinning the 'end' allows them to do that by zooming 
the oldest data away to the left to see detail of the anchored/pinned newest 
data or to see long trends, zooming out brings more of the old data into focus.
   
   With the start or end pinned /anchored, the anchored point can still be 
moved by dragging the chart or using the slider bar by grabbing the handles or 
slide tab. 
   
   This is a minimal patch that I think provides a great deal of new 
flexibility.
   
   The reason I made the patch was that I was trying to get this affect using 
myChart.setOption and event handlers to do it. It can be accomplished that way 
but it is messy to implement with the event handlers and has a major impact on 
performance with pixelization and slow rendering during zoom and few other 
undesirable side effects.  I took a look at the echarts code and saw that a 
simple patch with just a few lines of code would accomplish the objective with 
no side effects at all, hence the PR
   
   Please feel free to ask for any more details if you need them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to