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

Legend disappears on hover WinUI #1674

Open
jpageacsys opened this issue Oct 25, 2024 · 2 comments
Open

Legend disappears on hover WinUI #1674

jpageacsys opened this issue Oct 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jpageacsys
Copy link

Describe the bug
When I hover over my pie chart, the legend disappears

To Reproduce
I have a pie chart set up like this:

<lvc:PieChart
    MinWidth="600"
    Style="{StaticResource ChartStyle}"
    LegendPosition="Bottom"
    LegendTextPaint="{x:Bind KeyPaint}"
    TooltipBackgroundPaint="{x:Bind KeyBackground}"
    TooltipTextPaint="{x:Bind KeyPaint}"
    Series="{Binding PartStatus}"/>

The key binding is set to this in the page

public Paint KeyPaint
{
    get
    {
        if (ColorUtil.IsDark())
            return new SolidColorPaint(SKColors.White);
        else
            return new SolidColorPaint(SKColors.Black);
    }
}

public Paint KeyBackground
{
    get
    {
        if (ColorUtil.IsDark())
            return new SolidColorPaint(SKColors.Black);
        else
            return new SolidColorPaint(SKColors.White);
    }
}

Expected behavior
The legend should remain visible but instead disappears when I hover over the control.

Screenshots
Here's a video of it happening:
https://github.com/user-attachments/assets/b6eaf2b0-5e08-4699-80f4-a1b8c185e8d8

If I remove the binding to the text color it works but this looks bad in the dark theme:
image

I am using LiveCharts 2.0.0-rc4.5 for WinUI
Thanks!

@beto-rodriguez
Copy link
Owner

beto-rodriguez commented Oct 25, 2024

Strange I'll take a look; the good news is that now that is handled by the library, themes now work better.

You need to do something like #1458 (comment) then the library will set the colors based on the theme.

@jpageacsys
Copy link
Author

Thanks! I'll just switch over to using that.

@beto-rodriguez beto-rodriguez added the bug Something isn't working label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants