-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
BUGunexpected behaviorunexpected behaviorGood First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!
Description
Bug Report
Issue:
SignalPlotBase.FillDisable() causes an InvalidOperationException in certain cases:
ScottPlot/src/ScottPlot4/ScottPlot/Plottable/SignalPlotBase.cs
Lines 831 to 832 in 181be95
| if (_FillColor1 is null && _FillType != FillType.NoFill) | |
| throw new InvalidOperationException($"A Color must be assigned to FillColor1 to use fill type '{_FillType}'"); |
Reproducing:
var plt = new ScottPlot.Plot(600, 400);
var rand = new Random(0);
double[] values = DataGen.RandomWalk(rand, 100_000);
int sampleRate = 20_000;
var sig = plt.AddSignal(values, sampleRate);
//sig.FillAboveAndBelow(plt.GetSettings().GetNextColor(), plt.GetSettings().GetNextColor()); // <- uncommenting this line will not throw the exception but next line won't actually disable fill either
sig.FillDisable();
plt.SaveFig("example.png");I guess the cause is obvious:
ScottPlot/src/ScottPlot4/ScottPlot/Plottable/SignalPlotBase.cs
Lines 872 to 877 in 181be95
| public void FillDisable() | |
| { | |
| _FillType = FillType.FillBelow; | |
| _GradientFillColor1 = null; | |
| _GradientFillColor2 = null; | |
| } |
System Details
- ScottPlot Version: 4.1.61
- Operating System: Windows 11
- Application Type: WPF
- .NET Version: .NET Framework 4.8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BUGunexpected behaviorunexpected behaviorGood First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!