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.39k stars 574 forks source link

Issue with series.CornerRadius in LiveCharts2 #1453

Open BlackMomo17 opened 9 months ago

BlackMomo17 commented 9 months ago

I am using LiveCharts2 in my Avalonia UI project on Windows and I’m encountering an issue when I try to set the series.CornerRadius property for a PieSeries.

Here’s a snippet of my code:

public ObservableCollection<PieSeries<ObservableValue>> Series { get; set; } =
    GaugeGenerator.BuildSolidGauge(
        new GaugeItem(30, series =>
        {
            series.Fill = new SolidColorPaint(new SKColor(0, 255, 0));
            series.DataLabelsSize = 50;
            series.DataLabelsPaint = series.Fill;
            series.DataLabelsPosition = PolarLabelsPosition.ChartCenter;
            series.InnerRadius = 85;
            // series.CornerRadius = 30;  // This line causes the issue
        }),
        new GaugeItem(GaugeItem.Background, series =>
        {
            series.InnerRadius = 85;
            series.Fill = new SolidColorPaint(new SKColor(0, 255, 0, 20));
        }));

When I try to uncomment the line series.CornerRadius = value;, my program freezes and the user interface becomes unresponsive. I can’t click on other buttons or interact with the user interface in any way.

I’ve tried running this operation in a try/catch block and on a separate thread using Task.Run(), but the issue persists.

Any help on how to resolve this issue would be greatly appreciated. Thank you!

beto-rodriguez commented 2 months ago

Hello and thanks for the issue.

Sadly, this feature is not implemented yet, at this point please don't set that property.