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.86k stars 1.78k forks source link

Please, add gradient colours for the line depending on Y value for the LineChart (for example if y > 10 I need to set one color for the line, if y > 100 it should be another color) #1695

Closed MishaPadalka closed 4 months ago

MishaPadalka commented 5 months ago
image

I mean to have something like that, when the color of the line depends on the y value of the spot

Tobbyte commented 4 months ago

not sure what you mean. Could adding Stops to your gradient solve your problem? You could use them to define hard edges. https://css-tricks.com/books/greatest-css-tricks/hard-stop-gradients/

imaNNeo commented 4 months ago

Yes, you can add stops to your gradient to achieve the result. Check the LinearGradient and stops property. You can use it in the gradient property of LineChartBarData