ScottPlot / ScottPlot/ScottPlot
Render a Crosshair crashes due to System.Collections.Generic.KeyNotFoundException
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.8k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi togehter, first of all, thanks for the great plot library. You're doing a fantastic job :)
Issue: I use scott plot in my application. Sometimes my application crashes when using a crosshair due to a KeyNotFoundException. I have identify the code location: Plottables\HorizontalLine.cs#RenderLast(): line 60
float x = LabelOppositeAxis
? rp.DataRect.Right + LabelStyle.PixelPadding.Right
: rp.DataRect.Left - LabelStyle.PixelPadding.Left - rp.Layout.PanelOffsets[Axes.YAxis];
My Y-Axis changes its limits, so that it cannot be found in the Dictionary [rp.Layout.PanelOffsets[Axes.YAxis];]
ScottPlot Version: 5.0.54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Plottables\HorizontalLine.cs in RenderLast(), especially the PanelOffsets lookup at line 60. Reproduce the crosshair crash while changing the Y-axis limits, then verify that rendering completes without a KeyNotFoundException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100