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.77k stars 1.74k forks source link

Ability to set different colors for parts of the line from a line chart #1603

Open kaciula opened 6 months ago

kaciula commented 6 months ago

I want to be able to set different colors for different sections of a line from a line chart. For example, I want to have a red line from spots 1 to 10, a blue line from spots 10 to 40 etc.

Right now I can only set one single color or a gradient for the entire line. Is there a more low-level way of achieving what I need?

How I see this working is having a colors param that is the same length as the spots list and contains a color for each spot.

Screenshot 2024-03-09 at 11 29 02

imaNNeo commented 5 months ago

Unfortunately, it is not possible to do that at the moment. But it's a good feature that we need to have. Thanks for reporting it.