Search in sources :

Example 1 with CombinedCategoryPlot

use of org.jfree.experimental.chart.plot.CombinedCategoryPlot in project SIMVA-SoS by SESoS.

the class CombinedCategoryPlotDemo1 method createChart.

/**
 * Creates a chart.
 *
 * @return A chart.
 */
private static JFreeChart createChart() {
    CategoryDataset dataset1 = createDataset1();
    NumberAxis rangeAxis1 = new NumberAxis("Value");
    rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
    renderer1.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    CategoryPlot subplot1 = new CategoryPlot(dataset1, null, rangeAxis1, renderer1);
    subplot1.setDomainGridlinesVisible(true);
    CategoryDataset dataset2 = createDataset2();
    NumberAxis rangeAxis2 = new NumberAxis("Value");
    rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer renderer2 = new BarRenderer();
    renderer2.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2, renderer2);
    subplot2.setDomainGridlinesVisible(true);
    CategoryAxis domainAxis = new CategoryAxis("Category");
    CombinedCategoryPlot plot = new CombinedCategoryPlot(domainAxis, new NumberAxis("Range"));
    plot.add(subplot1, 2);
    plot.add(subplot2, 1);
    JFreeChart result = new JFreeChart("Combined Domain Category Plot Demo", new Font("SansSerif", Font.BOLD, 12), plot, true);
    return result;
}
Also used : LineAndShapeRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer) NumberAxis(org.jfree.chart.axis.NumberAxis) CategoryAxis(org.jfree.chart.axis.CategoryAxis) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) DefaultCategoryDataset(org.jfree.data.category.DefaultCategoryDataset) CategoryDataset(org.jfree.data.category.CategoryDataset) BarRenderer(org.jfree.chart.renderer.category.BarRenderer) CombinedCategoryPlot(org.jfree.experimental.chart.plot.CombinedCategoryPlot) CategoryPlot(org.jfree.chart.plot.CategoryPlot) JFreeChart(org.jfree.chart.JFreeChart) Font(java.awt.Font) CombinedCategoryPlot(org.jfree.experimental.chart.plot.CombinedCategoryPlot)

Aggregations

Font (java.awt.Font)1 JFreeChart (org.jfree.chart.JFreeChart)1 CategoryAxis (org.jfree.chart.axis.CategoryAxis)1 NumberAxis (org.jfree.chart.axis.NumberAxis)1 StandardCategoryToolTipGenerator (org.jfree.chart.labels.StandardCategoryToolTipGenerator)1 CategoryPlot (org.jfree.chart.plot.CategoryPlot)1 BarRenderer (org.jfree.chart.renderer.category.BarRenderer)1 LineAndShapeRenderer (org.jfree.chart.renderer.category.LineAndShapeRenderer)1 CategoryDataset (org.jfree.data.category.CategoryDataset)1 DefaultCategoryDataset (org.jfree.data.category.DefaultCategoryDataset)1 CombinedCategoryPlot (org.jfree.experimental.chart.plot.CombinedCategoryPlot)1