Search in sources :

Example 11 with DefaultPieDataset

use of org.jfree.data.general.DefaultPieDataset in project adempiere by adempiere.

the class MChart method getPieDataset.

public PieDataset getPieDataset() {
    dataset = new DefaultPieDataset();
    loadData();
    return (PieDataset) dataset;
}
Also used : DefaultPieDataset(org.jfree.data.general.DefaultPieDataset) DefaultPieDataset(org.jfree.data.general.DefaultPieDataset) PieDataset(org.jfree.data.general.PieDataset)

Example 12 with DefaultPieDataset

use of org.jfree.data.general.DefaultPieDataset 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)

Example 13 with DefaultPieDataset

use of org.jfree.data.general.DefaultPieDataset in project cubrid-manager by CUBRID.

the class VolumeFolderInfoEditor method createDataset.

/**
	 * create the dataset
	 *
	 * @param dbSpaceInfo DbSpaceInfo
	 * @return dataset
	 */
private DefaultPieDataset createDataset(DbSpaceInfo dbSpaceInfo) {
    int freeSize = dbSpaceInfo.getFreepage();
    int totalSize = dbSpaceInfo.getTotalpage();
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue(Messages.chartMsgUsedSize, new Double(totalSize - freeSize));
    dataset.setValue(Messages.chartMsgFreeSize, new Double(freeSize));
    return dataset;
}
Also used : DefaultPieDataset(org.jfree.data.general.DefaultPieDataset)

Example 14 with DefaultPieDataset

use of org.jfree.data.general.DefaultPieDataset in project cubrid-manager by CUBRID.

the class DatabaseStatusEditor method createDataset.

/**
	 *
	 * Create the chart dataset
	 *
	 * @param dbSpaceInfo the DbSpaceInfo
	 * @return the dataset
	 */
private DefaultPieDataset createDataset(DbSpaceInfo dbSpaceInfo) {
    int freeSize = dbSpaceInfo.getFreepage();
    int totalSize = dbSpaceInfo.getTotalpage();
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue(Messages.chartMsgUsedSize, (totalSize - freeSize) * (database.getDatabaseInfo().getDbSpaceInfoList().getPagesize() / (1048576.0f)));
    dataset.setValue(Messages.chartMsgFreeSize, (freeSize) * (database.getDatabaseInfo().getDbSpaceInfoList().getPagesize() / (1048576.0f)));
    return dataset;
}
Also used : DefaultPieDataset(org.jfree.data.general.DefaultPieDataset)

Aggregations

DefaultPieDataset (org.jfree.data.general.DefaultPieDataset)14 JFreeChart (org.jfree.chart.JFreeChart)4 PiePlot (org.jfree.chart.plot.PiePlot)4 StandardPieSectionLabelGenerator (org.jfree.chart.labels.StandardPieSectionLabelGenerator)3 Font (java.awt.Font)2 BigDecimal (java.math.BigDecimal)2 Account (jgnash.engine.Account)2 DefaultCategoryDataset (org.jfree.data.category.DefaultCategoryDataset)2 Color (java.awt.Color)1 Paint (java.awt.Paint)1 TexturePaint (java.awt.TexturePaint)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1