Skip to content

In a LineSeries, a single point can cause the curve to bend. #2065

@ping9719

Description

@ping9719

<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" Version="2.0.0-rc6.1" />

AMAML

<lvc:CartesianChart Grid.Row="1" LegendPosition="Top" Series="{Binding Series}" XAxes="{Binding XAxes}" YAxes="{Binding YAxes}" Background="WhiteSmoke"/>

C#

        public ISeries[] Series { get; set; } = new ISeries[]
        {
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Blue),Name = "qty", Values = null  },
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Green),Name = "ok", Values = null  },
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Red),Name = "ng", Values = null  },
        };

        public Axis[] XAxes { get; set; } = new Axis[]
        {
            new Axis{ Name = "data",MinStep=1, Labels=new string[]{ }}
        };

        public Axis[] YAxes { get; set; } = new Axis[]
        {
            new Axis{ Name = "",MinLimit=0}
        };

C# Button

                XAxes[0].Labels = dbdata.Select(o => o.day.ToString()).ToArray();
                Series[0].Values = dbdata.Select(o => o.count).ToArray();
                Series[1].Values = dbdata.Select(o => o.okCount).ToArray();
                Series[2].Values = dbdata.Select(o => o.notCount).ToArray();

Switching between individual points, success
https://github.com/user-attachments/assets/1b26215c-9952-4389-b0d0-c9cd200bf020
Image

Switching between multiple points and a single point failed
https://github.com/user-attachments/assets/dff113fe-9968-4e8e-b474-2770ecf0e2a9
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions