Example usage for org.jfree.chart.plot CombinedRangeXYPlot setOrientation

List of usage examples for org.jfree.chart.plot CombinedRangeXYPlot setOrientation

Introduction

In this page you can find the example usage for org.jfree.chart.plot CombinedRangeXYPlot setOrientation.

Prototype

@Override
public void setOrientation(PlotOrientation orientation) 

Source Link

Document

Sets the orientation for the plot (and all its subplots).

Usage

From source file:org.optaplanner.examples.cheaptime.swingui.CheapTimePanel.java

private JFreeChart createChart(CheapTimeSolution solution) {
    TangoColorFactory tangoColorFactory = new TangoColorFactory();
    NumberAxis rangeAxis = new NumberAxis("Period");
    rangeAxis.setRange(-0.5, solution.getGlobalPeriodRangeTo() + 0.5);
    XYPlot taskAssignmentPlot = createTaskAssignmentPlot(tangoColorFactory, solution);
    XYPlot periodCostPlot = createPeriodCostPlot(tangoColorFactory, solution);
    XYPlot capacityPlot = createAvailableCapacityPlot(tangoColorFactory, solution);
    CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(rangeAxis);
    combinedPlot.add(taskAssignmentPlot, 5);
    combinedPlot.add(periodCostPlot, 1);
    combinedPlot.add(capacityPlot, 1);/*  w  ww . j  a  v a2  s  .c  o  m*/

    combinedPlot.setOrientation(PlotOrientation.HORIZONTAL);
    return new JFreeChart("Cheap Power Time Scheduling", JFreeChart.DEFAULT_TITLE_FONT, combinedPlot, true);
}