Add ChartRangeSelector widget for interactive range selection and zooming
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
I propose adding a `ChartRangeSelector` widget that provides an interactive way to select and zoom ranges in fl_chart charts. This widget would wrap any chart and add draggable handles for range selection with the following features:
- Two draggable handles (left and right) for range selection
- Ability to drag the selection area for panning
- Smooth zoom animations when handles are dragged
- Double-tap to reset functionality
- Desktop-friendly with proper mouse cursors
- Customizable colors, sizes, and behaviors
Example usage would look like:
```dart
ChartRangeSelector(
child: LineChart(...),
)
```
### Describe alternatives you've considered
1. Using gesture detectors directly on charts, but this lacks visual feedback and is less intuitive
2. Implementing separate zoom buttons/slider, but this provides worse UX compared to direct manipulation
3. Using existing range selector packages, but they often lack proper integration with charts
### Additional context
I have already implemented this widget and can contribute the code.
Would you like me to prepare a PR with this feature, or should we discuss the implementation details first?
[Base implementation](https://gist.github.com/VadymMatus/bdfa05899bb988233582961ca5d2679a)
https://github.com/user-attachments/assets/551ccc9c-3699-4a9f-9c10-0a187a426d06
Contributor guide
Research direction
Start by reading the base implementation linked in the issue and compare it with the existing chart usage shown by LineChart(...). Define the widget's integration and interaction behavior around draggable handles, panning, zoom animation, reset, cursors, and customization; done means these behaviors work across the intended fl_chart charts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100