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

Manage z-index for Scatter Chart #1545

Closed
vbaulac opened this issue Jan 10, 2024 · 5 comments · Fixed by #1760
Closed

Manage z-index for Scatter Chart #1545

vbaulac opened this issue Jan 10, 2024 · 5 comments · Fixed by #1760
Labels
enhancement New feature or request good first issue Good for newcomers Scatter Chart

Comments

@vbaulac
Copy link

vbaulac commented Jan 10, 2024

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

@imaNNeo imaNNeo added enhancement New feature or request Scatter Chart good first issue Good for newcomers labels Jan 10, 2024
@hareendranmg
Copy link

Hi @vbaulac , Did you found any solution?

@imaNNeo
Copy link
Owner

imaNNeo commented Jul 19, 2024

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:

class ScatterSpot extends FlSpot with EquatableMixin {
/// You can change [show] value to show or hide the spot,
/// [x], and [y] defines the location of spot in the [ScatterChart],
/// [radius] defines the size of spot, and [color] defines the color of it.
ScatterSpot(
super.x,
super.y, {
bool? show,
FlDotPainter? dotPainter,
}) : show = show ?? true,
dotPainter = dotPainter ??
FlDotCirclePainter(
radius: 6,
color:
Colors.primaries[((x * y) % Colors.primaries.length).toInt()],
);

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

@mitulagr2
Copy link
Contributor

I can take this if you'd like!

@imaNNeo
Copy link
Owner

imaNNeo commented Oct 20, 2024

I can take this if you'd like!

Yes, that would be nice!

@imaNNeo
Copy link
Owner

imaNNeo commented Jan 6, 2025

This feature has just been added in 0.70.1. Please take a look!

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

Successfully merging a pull request may close this issue.

4 participants