Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical range annotations not showing in bar chart #709

Open
flocbit opened this issue Jul 2, 2021 · 2 comments
Open

Vertical range annotations not showing in bar chart #709

flocbit opened this issue Jul 2, 2021 · 2 comments
Labels
Bar Chart enhancement New feature or request

Comments

@flocbit
Copy link

flocbit commented Jul 2, 2021

Describe the bug
Unlike line charts, bar charts currently do not show VerticalRangeAnnotation.

Screenshots
The two charts below use the exact same annotations, but only the line chart shows the vertical ones...:

IMG_4B8784201684-1

Versions

  • which version of the Flutter are you using: 2.2.2
  • which version of the FlChart are you using: 0.36.2
@imaNNeo imaNNeo added Bar Chart enhancement New feature or request labels Jul 15, 2021
@goatandsheep
Copy link

I'm also facing the same issue. I used

RangeAnnotations(verticalRangeAnnotations: [
        VerticalRangeAnnotation(color: kGreyLine, x1: nowIndex - 0.5, x2: nowIndex + 0.5)
      ]

in both LineChart and BarChart. Despite it working perfectly in LineChart, it does not show up in BarChart

@goatandsheep
Copy link

@flocbit I figured it out. While linechart uses a range for the grid data and verticalrange annotation, barchart uses a value between 0-1. so to figure out where to put your verticalrange, you can do x1: nowIndex / readings.length, x2: (nowIndex + 1.0) / readings.length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bar Chart enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants