diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/SecuritiesChart.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/SecuritiesChart.java index 64f06c3042..652a581a9b 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/SecuritiesChart.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/SecuritiesChart.java @@ -576,6 +576,18 @@ else if (t instanceof PortfolioTransaction pt) }); } + private void setupTooltipDisplayCalculatedQuote(String seriesLabel) + { + TimelineChartToolTip toolTip = chart.getToolTip(); + + int precision = FormatHelper.getCalculatedQuoteDisplayPrecision(); + DecimalFormat calculatedFormat = new DecimalFormat(Values.CalculatedQuote.pattern()); + calculatedFormat.setMinimumFractionDigits(precision); + calculatedFormat.setMaximumFractionDigits(precision); + + toolTip.overrideValueFormat(seriesLabel, calculatedFormat); + } + private void addInvestmentTooltip(Composite composite, PortfolioTransaction t) { Label label = new Label(composite, SWT.NONE); @@ -584,7 +596,7 @@ private void addInvestmentTooltip(Composite composite, PortfolioTransaction t) label = new Label(composite, SWT.NONE); label.setText(MessageFormat.format(Messages.LabelToolTipInvestmentDetails, Values.Share.format(t.getShares()), - Values.Quote.format( + Values.CalculatedQuote.format( t.getGrossPricePerShare(converter.with(t.getSecurity().getCurrencyCode()))))); } @@ -1771,6 +1783,8 @@ private void createFIFOPurchaseLineSeries(List values, List d configureSeriesPainter(series, dates.toArray(new LocalDate[0]), Doubles.toArray(values), colorFifoPurchasePrice, 2, LineStyle.SOLID, false, seriesCounter == 0); + + setupTooltipDisplayCalculatedQuote(label); } private void addMovingAveragePurchasePrice(ChartInterval chartInterval) @@ -1865,6 +1879,8 @@ private void createMovingAveragePurchaseLineSeries(List values, List getLatestPurchasePrice()