use of name.abuchen.portfolio.ui.views.dataseries.DataSeriesSerializer in project portfolio by buchen.
the class ChartWidget method update.
@Override
public void update() {
title.setText(getWidget().getLabel());
try {
chart.suspendUpdate(true);
chart.getTitle().setText(title.getText());
for (ISeries s : chart.getSeriesSet().getSeries()) chart.getSeriesSet().deleteSeries(s.getId());
List<DataSeries> series = new DataSeriesSerializer().fromString(dataSeriesSet, get(ChartConfig.class).getData());
ReportingPeriod reportingPeriod = get(ReportingPeriodConfig.class).getReportingPeriod();
switch(useCase) {
case STATEMENT_OF_ASSETS:
buildAssetSeries(series, reportingPeriod);
break;
case PERFORMANCE:
buildPerformanceSeries(series, reportingPeriod);
break;
case RETURN_VOLATILITY:
throw new UnsupportedOperationException();
default:
throw new IllegalArgumentException();
}
chart.adjustRange();
} finally {
chart.suspendUpdate(false);
}
chart.redraw();
}
Aggregations