Note that there are some explanatory texts on larger screens.

plurals
  1. PODeviation Renderer in OverlaidXYPlot with JFreechart
    text
    copied!<p>I would like to use an Deviation renderer inside an Overlaid plot with JFreechart. But my problem is that i can't figure out how to change the axis into a custom one.</p> <p>Here are my other plots : </p> <pre><code>public class OverlaidXYPlotDemo extends ApplicationFrame { final XYSeries series0 = new XYSeries("Graph0"); final XYSeries series1 = new XYSeries("Graph1"); final XYSeries series2 = new XYSeries("Graph2"); final XYSeries series3 = new XYSeries("Graph3"); public OverlaidXYPlotDemo(final String title) { super(title); final JFreeChart chart = createOverlaidChart(); final ChartPanel panel = new ChartPanel(chart, true, true, true, true, true); panel.setPreferredSize(new java.awt.Dimension(800, 600)); chart.setBackgroundPaint(Color.white); JCheckBox chckbxCheck = new JCheckBox("CHECK"); panel.add(chckbxCheck, BorderLayout.SOUTH); setContentPane(panel); } public void addElem0(double x, double y) { this.series0.add(x, y); } public void addElem1(double x, double y) { this.series1.add(x, y); } private IntervalXYDataset createDataset0() { // create dataset 0... final XYSeriesCollection coll0 = new XYSeriesCollection(series0); return coll0; } private IntervalXYDataset createDataset1() { // create dataset 1... final XYSeriesCollection coll1 = new XYSeriesCollection(series1); return coll1; } private JFreeChart createOverlaidChart() { // Make the two axis final NumberAxis domainAxis = new NumberAxis("Speed (m / s)"); final ValueAxis rangeAxis = new NumberAxis("Power (kw)"); // create plot ... final IntervalXYDataset data0 = createDataset0(); final XYItemRenderer renderer0 = new XYBarRenderer(0.20); // change "new XYBarRenderer(0.20)" to "StandardXYItemRenderer()" if you want to change type of graph final XYPlot plot = new XYPlot(data0, domainAxis, rangeAxis, renderer0); // add a second dataset and renderer... final IntervalXYDataset data1 = createDataset1(); final XYLineAndShapeRenderer renderer1 = new XYLineAndShapeRenderer(false, true); // arguments of new XYLineAndShapeRenderer are to activate or deactivate the display of points or line. Set first argument to true if you want to draw lines between the points for e.g. plot.setDataset(1, data1); plot.setRenderer(1, renderer1); plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); return new JFreeChart("Test", JFreeChart.DEFAULT_TITLE_FONT, plot, true); } } </code></pre> <p><strong>I would like to do something like this with my deviation renderer.</strong> Any idea how to do that? :) If you want me to be more precise, or provide more code i will.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload