beto-rodriguez / LiveCharts2

Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
https://livecharts.dev
MIT License
4.24k stars 549 forks source link

Y axis label invisible on Dark Theme Mode. #1458

Open sigmarsson opened 6 months ago

sigmarsson commented 6 months ago

Describe the bug I change to dark theme and the Y axis labels aren't visible. X axis ones are.

To Reproduce

        [DependsOn(nameof(Context))]
        public IEnumerable<ICartesianAxis> AY => new[]
        {
            new Axis
            {
                Name = Context?.Unit ?? "#",
                NameTextSize = 13,
                TextSize = 13,
                CrosshairLabelsBackground = SKColors.DarkOrange.AsLvcColor(),
                CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkRed, 1),
                CrosshairPaint = new SolidColorPaint(SKColors.DarkOrange, 1),
                CrosshairSnapEnabled = true
            }
        };
        <lvc:CartesianChart Series="{x:Bind ViewModel.Data, Mode=OneWay}"
                            XAxes="{x:Bind ViewModel.AX, Mode=OneWay}"
                            Sections="{x:Bind ViewModel.ThresholdSections, Mode=OneWay}"
                            YAxes="{x:Bind ViewModel.AY, Mode=OneWay}"
                            TooltipPosition="Hidden"/>

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

image image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

Nugets:

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240205001-preview1" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" Version="2.0.0-rc2" />
frogcrush commented 3 months ago

In my case, I'm able to see the X and Y labels, but not the legend:

image

sigmarsson commented 3 months ago

Fabricate your own legend, it's better in the long term. I.e.

...
Bush-cat commented 1 month ago

You can set the Design to Light/Dark Mode manually, I had to do that as well and simply did this:

        // TODO only works with system theme! Integrate Theme Switcher
        if (App.Current.RequestedTheme == Microsoft.UI.Xaml.ApplicationTheme.Light)
        {
            LiveCharts.Configure(config => config.AddLightTheme());
        }
        else
        {
            LiveCharts.Configure(config => config.AddDarkTheme());
        }