DemoPanel demopanel = new DemoPanel(new GridLayout(2, 2));
demopanel.setPreferredSize(new Dimension(800, 600));
IntervalXYDataset intervalxydataset = createDataset();
JFreeChart jfreechart = createChart("Vertical", intervalxydataset);
XYPlot xyplot = (XYPlot) jfreechart.getPlot();
XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer();
xybarrenderer.setDrawBarOutline(false);
xybarrenderer.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F,
Color.red, 0.0F, 0.0F, Color.yellow));
xybarrenderer.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F,
Color.blue, 0.0F, 0.0F, Color.green));
xybarrenderer
.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.VERTICAL));
ChartPanel chartpanel = new ChartPanel(jfreechart);
demopanel.add(chartpanel);
JFreeChart jfreechart1 = createChart("Vertical / Inverted Axis",
intervalxydataset);
XYPlot xyplot1 = (XYPlot) jfreechart1.getPlot();
XYBarRenderer xybarrenderer1 = (XYBarRenderer) xyplot1.getRenderer();
xybarrenderer1.setDrawBarOutline(false);
xybarrenderer1.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F,
Color.red, 0.0F, 0.0F, Color.yellow));
xybarrenderer1.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F,
Color.blue, 0.0F, 0.0F, Color.green));
xybarrenderer1
.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.HORIZONTAL));
xyplot1.getDomainAxis().setInverted(true);
ChartPanel chartpanel1 = new ChartPanel(jfreechart1);
demopanel.add(chartpanel1);
JFreeChart jfreechart2 = createChart("Horizontal", intervalxydataset);
XYPlot xyplot2 = (XYPlot) jfreechart2.getPlot();
xyplot2.setOrientation(PlotOrientation.HORIZONTAL);
XYBarRenderer xybarrenderer2 = (XYBarRenderer) xyplot2.getRenderer();
xybarrenderer2.setDrawBarOutline(false);
xybarrenderer2.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F,
Color.red, 0.0F, 0.0F, Color.yellow));
xybarrenderer2.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F,
Color.blue, 0.0F, 0.0F, Color.green));
xybarrenderer2
.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_VERTICAL));
ChartPanel chartpanel2 = new ChartPanel(jfreechart2);
demopanel.add(chartpanel2);
JFreeChart jfreechart3 = createChart("Horizontal / Inverted Axis",
intervalxydataset);
XYPlot xyplot3 = (XYPlot) jfreechart3.getPlot();
xyplot3.setOrientation(PlotOrientation.HORIZONTAL);
XYBarRenderer xybarrenderer3 = (XYBarRenderer) xyplot3.getRenderer();
xybarrenderer3.setDrawBarOutline(false);
xybarrenderer3.setSeriesPaint(0, new GradientPaint(0.0F, 0.0F,
Color.red, 0.0F, 0.0F, Color.yellow));
xybarrenderer3.setSeriesPaint(1, new GradientPaint(0.0F, 0.0F,
Color.blue, 0.0F, 0.0F, Color.green));
xybarrenderer3
.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL));
xyplot3.getDomainAxis().setInverted(true);
ChartPanel chartpanel3 = new ChartPanel(jfreechart3);
demopanel.add(chartpanel3);