Search in sources :

Example 1 with MMeasure

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;
}
Also used : MMeasure(org.compiere.model.MMeasure) DefaultPieDataset(org.jfree.data.general.DefaultPieDataset) Calendar(java.util.Calendar) DefaultCategoryDataset(org.jfree.data.category.DefaultCategoryDataset)

Aggregations

Calendar (java.util.Calendar)1 MMeasure (org.compiere.model.MMeasure)1 DefaultCategoryDataset (org.jfree.data.category.DefaultCategoryDataset)1 DefaultPieDataset (org.jfree.data.general.DefaultPieDataset)1