Hello everyone,
i have a situation where i need to programmatically control zooming and panning inside the chart.
To this purpose i have implemented a solution based on what i found in your forums:
- i use a property that stores a basic configuration object for he xAxis config
- That basic config is used as initial value in a rxjs BehaviourSubject "focusXAxis"
- in the template i subscribe to it "[primaryXAxis]='focusXAxis | async'"
- in the component i have a method setZoom(zoomFactor, zoomPosition) The method nexts those values into the BehaviourSubject "focusXAxis"
That approach does cause the chart to change focus but there are 2 things i'm missing:
- my handcrafted approach does not emit a zoomComplete event (and i'd be fond of a solution that does that)
- it also shows an issue with the "enableScrollbar" feature of the zoomModel: The scrollbar does not update accordingly. That causes weird glitches when zooming around: To test, i just use 2 setTimeout calls that each call my handcrafted setter method at a different time with different values
Please advise on those 2 missing things.
Maybe there is even a smarter way, to control zooming programatically, that i have missed so far?
Many thanks and best regards