Search in sources :

Example 1 with StatementOfAssetsSeriesBuilder

use of name.abuchen.portfolio.ui.views.dataseries.StatementOfAssetsSeriesBuilder in project portfolio by buchen.

the class StatementOfAssetsHistoryView method createBody.

@Override
protected Composite createBody(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    chart = new TimelineChart(composite);
    chart.getTitle().setVisible(false);
    DataSeriesCache cache = make(DataSeriesCache.class);
    seriesBuilder = new StatementOfAssetsSeriesBuilder(chart, cache);
    configurator = new DataSeriesConfigurator(this, DataSeries.UseCase.STATEMENT_OF_ASSETS);
    configurator.addListener(() -> updateChart());
    DataSeriesChartLegend legend = new DataSeriesChartLegend(composite, configurator);
    // $NON-NLS-1$ //$NON-NLS-2$
    updateTitle(Messages.LabelStatementOfAssetsHistory + " (" + configurator.getConfigurationName() + ")");
    chart.getTitle().setText(getTitle());
    GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(0, 0).applyTo(composite);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(chart);
    GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.FILL).applyTo(legend);
    configurator.getSelectedDataSeries().forEach(series -> seriesBuilder.build(series, getReportingPeriod()));
    return composite;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) DataSeriesCache(name.abuchen.portfolio.ui.views.dataseries.DataSeriesCache) DataSeriesConfigurator(name.abuchen.portfolio.ui.views.dataseries.DataSeriesConfigurator) StatementOfAssetsSeriesBuilder(name.abuchen.portfolio.ui.views.dataseries.StatementOfAssetsSeriesBuilder) TimelineChart(name.abuchen.portfolio.ui.util.chart.TimelineChart) DataSeriesChartLegend(name.abuchen.portfolio.ui.views.dataseries.DataSeriesChartLegend)

Example 2 with StatementOfAssetsSeriesBuilder

use of name.abuchen.portfolio.ui.views.dataseries.StatementOfAssetsSeriesBuilder in project portfolio by buchen.

the class ChartWidget method buildAssetSeries.

private void buildAssetSeries(List<DataSeries> series, ReportingPeriod reportingPeriod) {
    StatementOfAssetsSeriesBuilder b1 = new StatementOfAssetsSeriesBuilder(chart, getDashboardData().getDataSeriesCache());
    series.forEach(s -> b1.build(s, reportingPeriod));
}
Also used : StatementOfAssetsSeriesBuilder(name.abuchen.portfolio.ui.views.dataseries.StatementOfAssetsSeriesBuilder)

Aggregations

StatementOfAssetsSeriesBuilder (name.abuchen.portfolio.ui.views.dataseries.StatementOfAssetsSeriesBuilder)2 TimelineChart (name.abuchen.portfolio.ui.util.chart.TimelineChart)1 DataSeriesCache (name.abuchen.portfolio.ui.views.dataseries.DataSeriesCache)1 DataSeriesChartLegend (name.abuchen.portfolio.ui.views.dataseries.DataSeriesChartLegend)1 DataSeriesConfigurator (name.abuchen.portfolio.ui.views.dataseries.DataSeriesConfigurator)1 Composite (org.eclipse.swt.widgets.Composite)1