Search in sources :

Example 1 with PieRenderer

use of com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer in project cubrid-manager by CUBRID.

the class VolumeInformationEditor method createChart.

/**
	 *
	 * Create jfreechart
	 *
	 * @param dataset DefaultPieDataset
	 * @return JFreeChart
	 */
private static JFreeChart createChart(DefaultPieDataset dataset) {
    JFreeChart chart = // chart
    ChartFactory.createPieChart3D(// chart
    "", // data
    dataset, // include legend
    true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 12));
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setCircular(false);
    plot.setLabelLinkMargin(0.0);
    plot.setLabelGap(0.0);
    plot.setLabelLinkStyle(PieLabelLinkStyle.QUAD_CURVE);
    plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
    plot.setLabelGenerator(null);
    plot.setLabelLinksVisible(false);
    plot.setLegendLabelGenerator(new org.jfree.chart.labels.StandardPieSectionLabelGenerator("{0}:{1} Mbyte", new DecimalFormat("0.00"), new DecimalFormat("0.00")));
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}={1}Mbyte {2}", new DecimalFormat("0.00"), new DecimalFormat("0.00%")));
    // plot.setSectionPaint("", SWTResourceManager.getColor(230, 230, 230));
    Color[] colors = { new Color(235, 139, 82), new Color(119, 119, 253) };
    PieRenderer renderer = new PieRenderer(colors);
    renderer.setColor(plot, dataset);
    return chart;
}
Also used : PiePlot3D(org.jfree.chart.plot.PiePlot3D) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) DecimalFormat(java.text.DecimalFormat) Color(java.awt.Color) ChartColor(org.jfree.chart.ChartColor) PieRenderer(com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer) JFreeChart(org.jfree.chart.JFreeChart)

Example 2 with PieRenderer

use of com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer in project cubrid-manager by CUBRID.

the class VolumeFolderInfoEditor method createChart.

/**
	 *
	 * Creates a chart.
	 *
	 * @param dataset DefaultPieDataset
	 * @param dbSpaceInfo DbSpaceInfo
	 * @return jFreeChart
	 */
private static JFreeChart createChart(DefaultPieDataset dataset, DbSpaceInfo dbSpaceInfo) {
    JFreeChart chart = ChartFactory.createPieChart3D(// chart
    dbSpaceInfo.getSpacename() + " Chart", // data
    dataset, // include legend
    true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 12));
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setCircular(false);
    plot.setLabelLinkMargin(0.0);
    plot.setLabelGap(0.0);
    plot.setLabelLinkStyle(PieLabelLinkStyle.QUAD_CURVE);
    plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}={1} pages {2}", new DecimalFormat("00.0"), new DecimalFormat("0.00%")));
    // plot.setSectionPaint("", SWTResourceManager.getColor(230, 230, 230));
    Color[] colors = { new Color(235, 139, 82), new Color(119, 119, 253) };
    PieRenderer renderer = new PieRenderer(colors);
    renderer.setColor(plot, dataset);
    return chart;
}
Also used : PiePlot3D(org.jfree.chart.plot.PiePlot3D) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) DecimalFormat(java.text.DecimalFormat) Color(java.awt.Color) ChartColor(org.jfree.chart.ChartColor) PieRenderer(com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer) JFreeChart(org.jfree.chart.JFreeChart)

Example 3 with PieRenderer

use of com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer in project cubrid-manager by CUBRID.

the class DatabaseStatusEditor method createChart.

/**
	 * Create the jfreeChart of pie
	 *
	 * @param dataset the dataset
	 * @param dbSpaceInfo the DbSpaceInfo
	 * @return the chart
	 */
private static JFreeChart createChart(DefaultPieDataset dataset, DbSpaceInfo dbSpaceInfo) {
    JFreeChart chart = ChartFactory.createPieChart3D(dbSpaceInfo.getType(), dataset, true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 12));
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setCircular(false);
    plot.setLabelLinkMargin(0.0);
    plot.setLabelGap(0.0);
    plot.setLabelLinksVisible(false);
    plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
    plot.setLabelGenerator(null);
    plot.setLegendLabelGenerator(new org.jfree.chart.labels.StandardPieSectionLabelGenerator("{0}:{1} Mbyte", new DecimalFormat("0.00"), new DecimalFormat("0.00")));
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}={1}Mbyte {2}", new DecimalFormat("0.00"), new DecimalFormat("0.00%")));
    java.awt.Color[] colors = { new java.awt.Color(235, 139, 82), new java.awt.Color(119, 119, 253) };
    PieRenderer renderer = new PieRenderer(colors);
    renderer.setColor(plot, dataset);
    return chart;
}
Also used : PiePlot3D(org.jfree.chart.plot.PiePlot3D) DecimalFormat(java.text.DecimalFormat) ChartColor(org.jfree.chart.ChartColor) Color(org.eclipse.swt.graphics.Color) JFreeChart(org.jfree.chart.JFreeChart) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) PieRenderer(com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer)

Aggregations

PieRenderer (com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer)3 DecimalFormat (java.text.DecimalFormat)3 ChartColor (org.jfree.chart.ChartColor)3 JFreeChart (org.jfree.chart.JFreeChart)3 StandardPieToolTipGenerator (org.jfree.chart.labels.StandardPieToolTipGenerator)3 PiePlot3D (org.jfree.chart.plot.PiePlot3D)3 Color (java.awt.Color)2 Color (org.eclipse.swt.graphics.Color)1