protected void crop(CategoryPlot plot) { // crop extra space around the graph plot.setInsets(new RectangleInsets(0, 0, 0, 5.0)); }
plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));
plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));
/** * Creates a new border with the specified line widths (in black). * * @param top the width of the top border. * @param left the width of the left border. * @param bottom the width of the bottom border. * @param right the width of the right border. */ public BlockBorder(double top, double left, double bottom, double right) { this(new RectangleInsets(top, left, bottom, right), Color.black); }
/** * Returns the current plot insets. * * @return The current plot insets. */ public RectangleInsets getPlotInsets() { if (this.plotInsets == null) { this.plotInsets = new RectangleInsets(0.0, 0.0, 0.0, 0.0); } return this.plotInsets; }
/** * Returns the current tick label insets value * * @return The current tick label insets value. */ public RectangleInsets getTickLabelInsets() { return (this.tickLabelInsets == null) ? new RectangleInsets(0, 0, 0, 0) : this.tickLabelInsets; }
/** * Creates a new border with the specified color. * * @param paint the color (<code>null</code> not permitted). */ public BlockBorder(Paint paint) { this(new RectangleInsets(1, 1, 1, 1), paint); }
/** * Returns the current label insets value * * @return The current label insets value. */ public RectangleInsets getLabelInsets() { return (this.labelInsets == null) ? new RectangleInsets(0, 0, 0, 0) : this.labelInsets; }
/** * Creates a new border with the specified line widths (in black). * * @param top the width of the top border. * @param left the width of the left border. * @param bottom the width of the bottom border. * @param right the width of the right border. * @param paint the border paint (<code>null</code> not permitted). */ public BlockBorder(double top, double left, double bottom, double right, Paint paint) { this(new RectangleInsets(top, left, bottom, right), paint); }
chart.getXYPlot().setDomainAxis(0, new DateAxis()); chart.getXYPlot().setDomainAxis(1, new DateAxis()); chart.getXYPlot().setInsets(new RectangleInsets(-15, 0, 0, 10));
/** * Creates a default border. */ public LineBorder() { this(Color.black, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0)); }
/** * Sets the padding. * * @param top the top padding. * @param left the left padding. * @param bottom the bottom padding. * @param right the right padding. */ public void setPadding(double top, double left, double bottom, double right) { setPadding(new RectangleInsets(top, left, bottom, right)); }
protected void crop(CategoryPlot plot) { // crop extra space around the graph plot.setInsets(new RectangleInsets(0, 0, 0, 5.0)); }
/** * Sets the margin. * * @param top the top margin. * @param left the left margin. * @param bottom the bottom margin. * @param right the right margin. * * @see #getMargin() */ public void setMargin(double top, double left, double bottom, double right) { setMargin(new RectangleInsets(top, left, bottom, right)); }
private void createChartPanel() { … JFreeChart chart = new JFreeChart("BoxAndWhiskerDemo", plot); LegendTitle legend = chart.getLegend(); legend.setFrame(new LineBorder(Color.white, new BasicStroke(1.0f), new RectangleInsets(1.0, 1.0, 1.0, 1.0))); legend.setItemFont(legend.getItemFont().deriveFont(16f)); chartPanel = new ChartPanel(chart); }
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; }
private void setLegend(JFreeChart chart) { chart.removeLegend(); final LegendTitle legend = new LegendTitle(new SpectrumLegendItemSource()); legend.setPosition(RectangleEdge.BOTTOM); LineBorder border = new LineBorder(Color.BLACK, new BasicStroke(), new RectangleInsets(2, 2, 2, 2)); legend.setFrame(border); chart.addLegend(legend); }
private void setLegend(JFreeChart chart) { chart.removeLegend(); final LegendTitle legend = new LegendTitle(new SpectrumLegendItemSource()); legend.setPosition(RectangleEdge.BOTTOM); LineBorder border = new LineBorder(Color.BLACK, new BasicStroke(), new RectangleInsets(2, 2, 2, 2)); legend.setFrame(border); chart.addLegend(legend); }
/** * Returns a horizontal line marker for the given x value and label. */ private Marker getMarker( Double value, String label ) { Marker marker = new ValueMarker( value ); marker.setPaint( Color.BLACK ); marker.setStroke( new BasicStroke( 1.1f ) ); marker.setLabel( label ); marker.setLabelOffset( new RectangleInsets( -10, 50, 0, 0 ) ); marker.setLabelFont( SUB_TITLE_FONT ); return marker; }
@Override public Object convert(String value) throws ParamException { Map map = parseMap(value, 4); return new RectangleInsets(getDoubleArg(map, "top"), getDoubleArg(map, "left"), getDoubleArg(map, "bottom"), getDoubleArg(map, "right")); } }