Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- Example to demonstrate how to create vertical BarSeries

### Fixed
- Validate unsupported histogram extreme value modes
- DateTimeAxis converting local time rather than UTC to TimeZone

### Changed
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Levi Botelho <levi_botelho@hotmail.com>
Linquize
lsowen
Luka B
Nikolay Zdravkov <unsafeptr@gmail.com>
Nils Haferkemper <nils@haferkemper.de>
Matt Ickstadt <mattico8@gmail.com>
Matt Williams
Expand Down
7 changes: 7 additions & 0 deletions Source/OxyPlot.Tests/Utilities/HistogramHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ public void CreateUniformBins_InvalidParameters()
Assert.Throws(typeof(ArgumentException), () => HistogramHelpers.CreateUniformBins(1.0, 1.0, 5));
}

[Test]
public void BinningOptions_InvalidExtremeValuesMode()
{
var exception = Assert.Throws<ArgumentException>(() => new BinningOptions(BinningOutlierMode.RejectOutliers, BinningIntervalType.InclusiveLowerBound, (BinningExtremeValueMode)999));
Assert.That(exception.ParamName, Is.EqualTo("extremeValuesMode"));
}

[Test]
public void CreateUniformBins_SingleBin()
{
Expand Down
6 changes: 3 additions & 3 deletions Source/OxyPlot/Utilities/BinningOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ public BinningOptions(BinningOutlierMode outlierMode, BinningIntervalType interv
throw new ArgumentException(nameof(outlierMode), "Unsupported bin interval type");
}

if (intervalType != BinningIntervalType.InclusiveLowerBound &&
intervalType != BinningIntervalType.InclusiveUpperBound)
if (extremeValuesMode != BinningExtremeValueMode.ExcludeExtremeValues &&
extremeValuesMode != BinningExtremeValueMode.IncludeExtremeValues)
{
throw new ArgumentException(nameof(outlierMode), "Unsupported bin interval type");
throw new ArgumentException("Unsupported bin extreme values mode", nameof(extremeValuesMode));
Comment thread
unsafePtr marked this conversation as resolved.
Resolved
}

this.OutlierMode = outlierMode;
Expand Down