use of org.compiere.model.MMeasure in project adempiere by adempiere.
the class GraphBuilder method loadData.
/**
*
* @return graph column list
*/
public ArrayList<GraphColumn> loadData() {
// Calculated
MMeasure measure = getMGoal().getMeasure();
if (measure == null) {
log.warning("No Measure for " + getMGoal());
return null;
}
ArrayList<GraphColumn> list = measure.getGraphColumnList(getMGoal());
pieDataset = new DefaultPieDataset();
dataset = new DefaultCategoryDataset();
for (int i = 0; i < list.size(); i++) {
String series = m_X_AxisLabel;
if (list.get(i).getDate() != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(list.get(i).getDate());
series = Integer.toString(cal.get(Calendar.YEAR));
}
dataset.addValue(list.get(i).getValue(), series, list.get(i).getLabel());
linearDataset.addValue(list.get(i).getValue(), m_X_AxisLabel, list.get(i).getLabel());
pieDataset.setValue(list.get(i).getLabel(), list.get(i).getValue());
}
return list;
}
Aggregations