I'm currently playing with ESnet's react timeseries charting components, with the specific goal of allowing a user to zoom into a displayed chart, as in their currency example.
According to their documentation and to the best of my understanding of the example's source code, it should be enough, if one is rendering a chart like this:
<ChartContainer timeRange={series.range()}>
...
</ChartContainer>
To add enablePanZoom={true}
to the props to enable zooming. E.g:
<ChartContainer timeRange={series.range()} enablePanZoom={true}>
...
</ChartContainer>
However, this is not working and I cannot understand why. I guess something from the doc or the example eludes me:
- running the zoomable examples locally works as expected
- running the non-zoomable example with the zoom flag enabled does not work
Hence, the question: How to make a react-timeseries-charts chart zoomable?
edit: Turns out the answer was obvious: one must make use of onTimeRangeChanged
and update the state, otherwise, well, poof...