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.71k stars 1.73k forks source link

Manage z-index for Scatter Chart #1545

Open vbaulac opened 8 months ago

vbaulac commented 8 months ago

Hi.

It would be very nice to be able to manage a z-index in the Scatter plot. I have a lot of point in my scatter plot, and they do not have the same color. And some are more important than others. I'd like them to be on front, so they are not hidden by others.

Current hack would probably be to change the order of the array of my Spots, but it is an hack.

Having a z-index property, CSS-style, would be super.

Thanks for this awesome lib !

Victor

hareendranmg commented 1 month ago

Hi @vbaulac , Did you found any solution?

imaNNeo commented 1 month ago

It's a good starting point for contributing, you can just read the guideline and open your PR. We can add a property (for example called renderPriority which is null by default) here: https://github.com/imaNNeo/fl_chart/blob/11d13a78e6a134aa0cfdcd8dfa88dceaf79a4033/lib/src/chart/scatter_chart/scatter_chart_data.dart#L189-L204

Then when rendering it, you can sort them by the renderPriority if any point has this property.