Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

System.InvalidOperationException: Sequence contains no elements when only dobule.NaN values are added to the LineSeries. #1991

Copy link
Copy link
@rlamp

Description

@rlamp
Issue body actions

Steps to reproduce

  1. Add some double.NaN points to an empty line series (which is using smoothing).
  2. Crash.

Platform.
.NET version: .NET 6

Expected behaviour

The application should not crash, plot should stay unchanged.

Actual behaviour

The application crashes with the following exception and stack trace

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Min[TSource](IEnumerable1 source, Func2 selector)
   at OxyPlot.Series.LineSeries.UpdateMaxMin() in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot\Series\LineSeries.cs:line 426
   at OxyPlot.PlotModel.UpdateMaxMin(Boolean isDataUpdated) in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot\PlotModel\PlotModel.cs:line 1171
   at OxyPlot.PlotModel.OxyPlot.IPlotModel.Update(Boolean updateData) in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot\PlotModel\PlotModel.cs:line 801

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.