use of name.abuchen.portfolio.ui.util.chart.TimelineChartToolTip in project portfolio by buchen.
the class SecuritiesChart method setupTooltip.
private void setupTooltip() {
TimelineChartToolTip toolTip = chart.getToolTip();
toolTip.setValueFormat(new DecimalFormat(Values.Quote.pattern()));
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.LabelChartDetailClosingIndicator + "Positive");
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.LabelChartDetailClosingIndicator + "Negative");
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.LabelChartDetailClosingIndicator + "Zero");
toolTip.addSeriesExclude(Messages.SecurityMenuBuy);
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.SecurityMenuBuy + "1");
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.SecurityMenuBuy + "2");
toolTip.addSeriesExclude(Messages.SecurityMenuSell);
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.SecurityMenuSell + "1");
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.SecurityMenuSell + "2");
toolTip.addSeriesExclude(Messages.LabelChartDetailDividends);
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.LabelChartDetailDividends + "1");
// $NON-NLS-1$
toolTip.addSeriesExclude(Messages.LabelChartDetailDividends + "2");
toolTip.addSeriesExclude(Messages.LabelChartDetailBollingerBands);
toolTip.addExtraInfo((composite, focus) -> {
if (focus instanceof Date) {
Instant instant = ((Date) focus).toInstant();
ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());
LocalDate date = zdt.toLocalDate();
Interval displayInterval = Interval.of(date.minusDays(5), date.plusDays(5));
//
customTooltipEvents.stream().filter(//
t -> displayInterval.contains(t.getDateTime())).forEach(t -> {
if (t instanceof AccountTransaction)
addDividendTooltip(composite, (AccountTransaction) t);
else if (t instanceof PortfolioTransaction)
addInvestmentTooltip(composite, (PortfolioTransaction) t);
});
}
});
}
use of name.abuchen.portfolio.ui.util.chart.TimelineChartToolTip in project portfolio by buchen.
the class AbstractChartTab method attachTooltipTo.
protected void attachTooltipTo(Chart chart) {
TimelineChartToolTip toolTip = new TimelineChartToolTip(chart);
toolTip.enableCategory(true);
}
Aggregations