I am using a custom component based on the MultiPaneStockChart example which has the very nice overview scrollbar. I like a lot about this except for the scrolling behavior when clicked. When you click on either side of the “viewport” in the non-selected region it pans all the way to that spot. How would I go about changing this behavior so that it advances only one screen or page at a time (i.e. advances by the width or number of points that are in current XAxisVisibleRange)? In other words, if I am zoomed in on the middle of the chart so that only a portion is shown, whether I click immediately to the right of the viewport or two inches away it should scroll by the same amount. I see the SciChartScollBar exposes a SelectedRangeChanged event but I want to intercept before the range is changed. Thank you.
Best regards,
Lawson
- Lawson McWhorter asked 7 years ago
- You must login to post comments
Hi Lawson
The SciChartScrollBar has a mouse click handler which causes it to zoom to the clicked location. Looking a the code for SciChart there is no way to customise this behaviour without modifying the source code for ScIChartScrollbar.
If you do have access to the source via source-code license, and want to do it, the change is simple. You need to change the method ScIChartScrollbar.OnNonSelectedAreaMouseLeftButtonUp(). If not then I’m afraid there is no endpoint for customisation of this behaviour.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 7 years ago
-
Thanks Andrew. Unfortunately no source code license for me but thank for responding and saving me the time from trying unsuccessfully. BTW, I think this is a common workflow–to zoom into the desired level and then want to page forwards/backwards. Since you can drag the viewport to the desired spot for long pans that would be my preferred method. I have captured the pageup and pagedown keys to allow me to move forwards/backwards as I described but it is still disconcerting to click the scroll bar and have it move multiple pages. Hard to undo 25 years of muscle memory from using financial charts. Perhaps a future version can expose a method for customization. Thank you!
- You must login to post comments
Please login first to submit.