JRDesignExpression expression = new JRDesignExpression();
// expression.setText("$F{" + chart.getColumn().getTitle().toLowerCase() + "}");
expression.setText("$F{" + ((PropertyColumn) chart.getColumn()).getColumnProperty().getProperty() + "}");
expression.setValueClass(clazz);
JRDesignVariable var = new JRDesignVariable();
var.setValueClass(clazz);
var.setExpression(expression);
var.setCalculation(chart.getOperation());
var.setResetGroup(group);
var.setResetType(JRBaseVariable.RESET_TYPE_GROUP);
int chartIndex = getReport().getCharts().indexOf(chart); //use the index as part of the name just because I may want 2
//different types of chart from the very same column (with the same operation also) making the variables name to be duplicated
var.setName("CHART_[" + chartIndex + "+]_" + group.getName() + "_" + chart.getColumn().getTitle() + "_" + chart.getOperation());
// JRDesignExpression initExp = new JRDesignExpression();
// initExp.setText("new Float(0)");
// initExp.setValueClass(clazz);
// var.setInitialValueExpression(initExp);