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

Marker text is not show when data size is one #910

Open
chaeeunDev opened this issue Oct 4, 2024 · 4 comments
Open

Marker text is not show when data size is one #910

chaeeunDev opened this issue Oct 4, 2024 · 4 comments

Comments

@chaeeunDev
Copy link

How to reproduce

There is only one data size, and the text inside the marker is not displayed when the marker is used in the line graph using the point provider.

Additionally, I'm using a basic marker and a persistent marker at the same time, and when I click it, the basic marker detects the event first and remembers the index to display the persistent mark.

#897

Observed behavior

When the data size is large, the text inside the marker pops up well, but strangely, the text doesn't pop up when it's 1 size

Expected behavior

I hope the text on the marker will pop up well even when there is 1 data.

Vico version(s)

2.0.0-beta.1

Android version(s)

minSdk is 28, comple and target sdk is 34

Additional information

marker = rememberMarker(MaterialTheme.colorScheme.surfaceVariant),
markerVisibilityListener = object : CartesianMarkerVisibilityListener {
override fun onHidden(marker: CartesianMarker) {
// TODO("Not yet implemented")
}

            override fun onShown(
                marker: CartesianMarker,
                targets: List<CartesianMarker.Target>
            ) {
                clickIndex(targets.first().x.toFloat())
            }
        },
        getXStep = { 1.0 },
        horizontalLayout = HorizontalLayout.FullWidth(),
        persistentMarkers = rememberExtraLambda( marker) { marker at selectedIndex },
@chaeeunDev chaeeunDev added the bug label Oct 4, 2024
@Gowsky
Copy link
Member

Gowsky commented Oct 5, 2024

Hello, @chaeeunDev. Thanks for the report. We'll look into it.

The problem lies in color extraction. If you have only one series (or multiple series with the same line color), you can temporarily solve this by updating your CartesianMarker so that the appropriate color is defined statically and not extracted. See the color parameter of rememberTextComponent and the colorCode property of DefaultCartesianMarkerValueFormatter.

@chaeeunDev
Copy link
Author

chaeeunDev commented Oct 6, 2024

Oh thank you @Gowsky! I will fix the bug according to the method you told me!
And did you succeed in recreating the bug I presented? I will attach more codes and photos if necessary!

@patrickmichalik
Copy link
Member

We have been able to reproduce this, @chaeeunDev. Cheers!

@chaeeunDev
Copy link
Author

That's good news! I'll be waiting for you to solve the problem!
Thank you! @patrickmichalik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants