mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.92k stars 1.19k forks source link

[charts] Allow to zoom on data #12503

Open joserodolfofreitas opened 3 months ago

joserodolfofreitas commented 3 months ago

We can currently zoom with axis properties min/max. But this kind of feature still requires:

DX

Zoom behavior

Allows to choos if the axis interact together (see #12083) this is well defined in the section "How dataZoom components operates axes and data" https://echarts.apache.org/en/option.html#dataZoom

Display

Inside zoom

Allow to modify the zoom state by mousse interaction inside the chart

https://echarts.apache.org/en/option.html#dataZoom-inside https://api.highcharts.com/highcharts/chart.zooming.mouseWheel

Slider zoom

Allow to modify the zoom state with sliders

https://echarts.apache.org/en/option.html#dataZoom-slider https://api.highcharts.com/highstock/navigator

Search keywords:

siseko commented 2 months ago

This would be a pretty sweet feature

JCQuintas commented 1 month ago

Zoom Behaviour

Zoom & Pan Gestures

Allows users to zoom and pan using mouse/touch events. Seems to be the most straight forward for allowing users to interact with your data.

Will need customisation to allow which axis can be zoomed.

Examples: echarts, victory, visx, scichart

Takes:

Zoom with Click & Drag

It allows the user to "select" an area they want to zoom by "click & dragging" in the chart container. If the user wants to "zoom out" we need a different behaviour or button to handle that.

It doesn't feel as intuitive as Zoom & Pan Gestures, but could be helpful if you don't want users zooming in while scrolling. scichart actually allows it together with Zoom & Pan Gestures, by using different patterns for each behaviour.

Examples: highcharts, recharts, apexcharts

Takes:

JCQuintas commented 1 month ago

Visualisation / Overview

Slider

Is a helper component that allows the visualisation of the current zoom state. Usually shown as a Slider which is often called a Brush as well. It works good for line charts and series data, is a bit odd for scatter data, but can work as well if the axis are properly formatted.

Examples: echarts, visx brush, victory, scichart

Takes:

Area Overview

Works better on non linear data, like scatter charts, but would require a different implementation.

Examples: visx zoom

JCQuintas commented 1 month ago

Axis Binding

The scichart library allows zooming to be bound to two different axis. Same for Echart by providing the xAxisIndex

Takes:

github-actions[bot] commented 2 days ago

:warning: This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@joserodolfofreitas: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.