Skip to content

Ghost points / overshoot when setting ISeries.Values with fewer values #2040

@Dresel

Description

@Dresel

Describe the bug

When updating a LineSeries (spline) in Blazor with a new Values collection that contains fewer points than the previous one, the spline still appears to use old control points.
This results in a visible spline artifact at the end of the line, as if “ghost points” from the previous dataset were still present.

To Reproduce

Steps to reproduce the behavior:

  1. Initialize a LineSeries with a larger dataset (e.g. 12 points).
  2. Later update the same series with a smaller dataset (e.g. 8 points): Series[0].Values = smallerValues;

Can be reproduced with the following code:

private ISeries[] _series =
{
    new LineSeries<double>
    {
        Values = [2, 1, 3, 5, 3, 4, 6],
        Fill = null
    }
};

protected override async Task OnInitializedAsync()
{
    await base.OnInitializedAsync();

    await Task.Run(async () =>
    {
        await Task.Delay(5000);
        _series[0].Values = new double[] { 3, 5, 2, 8, };
        _ = InvokeAsync(StateHasChanged);
    });
}

Screenshots

Image

Additional context

Happens after upgrading LiveChartsCore.SkiaSharpView.Blazor from 2.0.0-rc5.4.1 to 2.0.0-rc6
Clearing, Task.Delay with 100ms and then setting the new values works sometime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions