use of org.xwiki.rendering.internal.macro.chart.source.SimpleChartModel in project xwiki-platform by xwiki.
the class AbstractTableBlockDataSource method buildDataset.
@Override
public void buildDataset(String macroContent, Map<String, String> parameters, MacroTransformationContext context) throws MacroExecutionException {
validateParameters(parameters);
TableBlock tableBlock = getTableBlock(macroContent, context);
int[] dataRange = getDataRange(tableBlock);
TableDatasetBuilder datasetBuilder;
setChartModel(new SimpleChartModel());
switch(getDatasetType()) {
case CATEGORY:
datasetBuilder = new TableCategoryDatasetBuilder();
break;
case PIE:
datasetBuilder = new TablePieDatasetBuilder();
break;
case TIMETABLE_XY:
datasetBuilder = new TableTimeTableXYDatasetBuilder();
break;
default:
throw new MacroExecutionException(String.format("Unsupported dataset type [%s]", getDatasetType().getName()));
}
setAxes();
datasetBuilder.setLocaleConfiguration(getLocaleConfiguration());
datasetBuilder.setParameters(parameters);
if (SERIES_COLUMNS.equals(series)) {
datasetBuilder.setTranspose(true);
}
buildDataset(tableBlock, dataRange, datasetBuilder);
setDataset(datasetBuilder.getDataset());
}
Aggregations