imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.7k stars 1.73k forks source link

Vertical grid lines in bar graphs #1149

Open noinskit opened 1 year ago

noinskit commented 1 year ago

BarCharts seem to ignore vertical lines set up in their FlGridData.

I understand from https://github.com/imaNNeoFighT/fl_chart/issues/92 that this was removed on purpose:

we decided to remove the horizontal value concept from the BarChart. That's why we don't show anything.
Feel free to make a new issue to follow up on this decision. I need to understand the use case (Because I think in the barChart the only yAxis is important).

So here's my use case: I've got a screen with several graphs, line and bar, and they all describe the same time range, e.g. last quarter with one datapoint per week. I'd like to put vertical lines in the grid separating months which do not always fall between weeks. It works great in LineChart, but it does not with a BarChart using identical FlGridData.

imaNNeo commented 1 year ago

The problem is that we cannot decide whether to show the bars on the axis values (1, 2, 3, ...) or show them independently on the chart because we support BarChartData.alignment (BarChartAlignment) that is works independently from axis values.

I think we need to support two types of BarCharts

  1. BarChart that is independent of axis values (works with alignment and does not work with the x-axis, they just work with alignment and available space on the screen)
  2. BarChart that is dependent on axis values (we have an x-axis and bars can be aligned with x-axis values and the developer is responsible to take care of showing them)

What do you think?

BTW it is somehow related to #709

Finni123 commented 10 months ago

Are vertical extra lines in bar graph still impossible?

imaNNeo commented 9 months ago

Are vertical extra lines in bar graph still impossible?

Yes, you can follow the thread for the future releases, I will notify you here when we implemented it.

KerimYilPROCON commented 3 months ago

Any updates on this yet? @imaNNeo

pedrostick3 commented 2 months ago

I just came to say that I need this feature too and unfortunatily I'll need to try to make some unnecessary workaround on this...

Iridescentangle commented 1 month ago

I just came to say that I need this feature too and unfortunatily I'll need to try to make some unnecessary workaround on this...

I also found this problem...I thought it was my incorrect settings so I tried so many times but finally found that's a known problem😭 Now I have to put the BarChart into a Stack and use a Positioned widget to achieve the target