Skip to content

Commit

Permalink
Skip data series with infinite values in returns volatility chart
Browse files Browse the repository at this point in the history
Infinite values result in an IllegalArgumentException when SWTChart
is adjusting the range.

Issue: https://forum.portfolio-performance.info/t/fehlermeldung-illegal-range-lower-infinity-upper-0-10238103115053554/24485
  • Loading branch information
buchen committed Nov 3, 2023
1 parent 4924c82 commit df77f7e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ private void setChartSeries()
double risk = this.riskMetric.getRisk(index);
double retrn = this.useIRR ? index.getPerformanceIRR() : index.getFinalAccumulatedPercentage();

if (Double.isInfinite(risk) || Double.isInfinite(retrn))
return;

ILineSeries lineSeries = chart.addScatterSeries(series.getUUID(), new double[] { risk },
new double[] { retrn }, series.getLabel());

Expand Down

0 comments on commit df77f7e

Please sign in to comment.