public Class getTimePeriodClass() {
return timePeriodClass;
}
public JRDesignChartDataset transform(DynamicJasperDesign design, String name, JRDesignGroup group, JRDesignGroup parentGroup, Map vars) {
JRDesignTimeSeriesDataset data = new JRDesignTimeSeriesDataset(null);
if (timePeriodClass != null)
data.setTimePeriod(timePeriodClass);
for (Iterator iterator = series.iterator(); iterator.hasNext();) {
JRDesignTimeSeries serie = new JRDesignTimeSeries();
AbstractColumn column = (AbstractColumn) iterator.next();
//And use it as value for each bar
JRDesignExpression varExp = getExpressionFromVariable((JRDesignVariable) vars.get(column));
serie.setValueExpression(varExp);
//The key for each bar
JRExpression exp2 = group.getExpression();
JRDesignExpression exp3;
if (seriesLabels.containsKey(column)) {
exp3 = ExpressionUtils.createAndRegisterExpression(design, "dataset_" + column.getName() + "_" + name, (CustomExpression) seriesLabels.get(column));
}
else {
exp3 = new JRDesignExpression();
exp3.setText("\"" + column.getTitle() + "\"");
}
exp3.setValueClass(String.class);
serie.setTimePeriodExpression(exp2);
serie.setLabelExpression(exp3);
serie.setSeriesExpression(exp3);
data.addTimeSeries(serie);
}
setResetStyle(data, group, parentGroup);
return data;