imaNNeo / imaNNeo/fl_chart

BarChart: get bar index on touch?

Open
#720 1 comment 0 reactions 0 assignees View on GitHub
Bar Chart
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

fl_chart: ^0.12.2 here.

I need to be able to run a callback on touching a BarChart's bar, and I'm using touchCallback to handle this.
I'd like to get info that would tell me which bar has been touched, like an index, and tried to use barTouchResponse.spot, but it's value is always null.

![image](https://user-images.githubusercontent.com/2078582/126325317-12d3b868-a856-44ec-a2ec-e733eddb7a3e.png)

Is it possible?

Contributor guide

Open the contributing guide

Research direction

Start by tracing BarChart's touchCallback handling and the barTouchResponse.spot value described in the issue. Check how touched bars are represented in the current fl_chart version and determine what information the callback exposes. Done means a touch callback can reliably identify the touched bar, with behavior covered by the relevant existing tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.