chart.getXYPlot().setDomainAxis(0, new DateAxis()); chart.getXYPlot().setDomainAxis(1, new DateAxis()); chart.getXYPlot().setInsets(new RectangleInsets(-15, 0, 0, 10));
private static <T extends XYPlot> T defaultPlot(T plot) { plot.setOutlineVisible(false); plot.setInsets(new RectangleInsets(5, 5, 5, 30)); plot.setBackgroundAlpha(0.0f); return plot; }
/** * Adds a subplot with a particular weight (greater than or equal to one). * The weight determines how much space is allocated to the subplot * relative to all the other subplots. * <br><br> * You must ensure that the subplot has a non-null domain axis. The range * axis for the subplot will be set to {@code null}. * * @param subplot the subplot ({@code null} not permitted). * @param weight the weight (must be 1 or greater). */ public void add(XYPlot subplot, int weight) { Args.nullNotPermitted(subplot, "subplot"); if (weight <= 0) { String msg = "The 'weight' must be positive."; throw new IllegalArgumentException(msg); } // store the plot and its weight subplot.setParent(this); subplot.setWeight(weight); subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); subplot.setRangeAxis(null); subplot.addChangeListener(this); this.subplots.add(subplot); configureRangeAxes(); fireChangeEvent(); }
/** * Adds a subplot with a particular weight (greater than or equal to one). * The weight determines how much space is allocated to the subplot * relative to all the other subplots. * <br><br> * You must ensure that the subplot has a non-null domain axis. The range * axis for the subplot will be set to <code>null</code>. * * @param subplot the subplot. * @param weight the weight (must be 1 or greater). */ public void add(XYPlot subplot, int weight) { // verify valid weight if (weight <= 0) { String msg = "The 'weight' must be positive."; throw new IllegalArgumentException(msg); } // store the plot and its weight subplot.setParent(this); subplot.setWeight(weight); subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); subplot.setRangeAxis(null); subplot.addChangeListener(this); this.subplots.add(subplot); configureRangeAxes(); fireChangeEvent(); }
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false); subplot.setDomainAxis(null); subplot.addChangeListener(this);
/** * Adds a subplot with the specified weight and sends a * {@link PlotChangeEvent} to all registered listeners. The weight * determines how much space is allocated to the subplot relative to all * the other subplots. * <P> * The domain axis for the subplot will be set to {@code null}. You * must ensure that the subplot has a non-null range axis. * * @param subplot the subplot ({@code null} not permitted). * @param weight the weight (must be >= 1). */ public void add(XYPlot subplot, int weight) { Args.nullNotPermitted(subplot, "subplot"); if (weight <= 0) { throw new IllegalArgumentException("Require weight >= 1."); } // store the plot and its weight subplot.setParent(this); subplot.setWeight(weight); subplot.setInsets(RectangleInsets.ZERO_INSETS, false); subplot.setDomainAxis(null); subplot.addChangeListener(this); this.subplots.add(subplot); ValueAxis axis = getDomainAxis(); if (axis != null) { axis.configure(); } fireChangeEvent(); }