infinum / flutter-charts

Customizable charts library for flutter.
https://pub.dev/packages/charts_painter
MIT License
144 stars 42 forks source link

Incorrect item width for OnItemClicked #61

Closed vsilux closed 1 year ago

vsilux commented 2 years ago

The width of the element to detect clicks on chart elements is calculated by the size of the entire chart widget. But when we use Y-axis decoration with showValues: true, the width of the chart decreases. Thus, the width of the element (bar) decreased. This causes a problem in _ChartWidget. _getClickLocation due to an incorrectly calculated item index that is forwards to: ChartBehavior._onChartItemClicked

itsJoKr commented 1 year ago

We completely changed the click handling, so onItemClicked should work differently.