ValueAxis axis = plot.getDomainAxis(); axis.setLowerMargin(0); axis.setUpperMargin(0);
private void resetAxes() { plot.getRangeAxis().setLowerMargin( 0 ); plot.getRangeAxis().setUpperMargin( 0 ); plot.getDomainAxis().setLowerMargin( 0 ); plot.getDomainAxis().setUpperMargin( 0 ); }
private void resetAxes() { plot.getRangeAxis().setLowerMargin( 0 ); plot.getRangeAxis().setUpperMargin( 0 ); plot.getDomainAxis().setLowerMargin( 0 ); plot.getDomainAxis().setUpperMargin( 0 ); }
public XYChartBuilder setDateXAxis(final boolean showAxisValues) { xAxis = new DateAxis(); ((DateAxis) xAxis).setTickMarkPosition(DateTickMarkPosition.MIDDLE); xAxis.setLowerMargin(0.0); xAxis.setUpperMargin(0.0); xAxis.setVisible(showAxisValues); plot.setDomainAxis(xAxis); return this; }
@Override protected JFreeChart createGraph() { TimeTableXYDataset dataset = createDataset(); ValueAxis xAxis = new DateAxis(); xAxis.setLowerMargin(0.0); xAxis.setUpperMargin(0.0); Calendar lowerBound = getLowerGraphBound(); xAxis.setRange(lowerBound.getTimeInMillis(), Calendar.getInstance().getTimeInMillis()); NumberAxis yAxis = new NumberAxis(Y_AXIS_LABEL); yAxis.setRange(0, HUNDRED_PERCENT); XYItemRenderer renderer = new XYBarRenderer(); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(graphTitle, JFreeChart.DEFAULT_TITLE_FONT, plot, true); chart.removeLegend(); return chart; }
public static JFreeChart createTimeSeriesChart( XYDataset dataset, String title, String timeAxisLabel, String valueAxisLabel ) { ValueAxis timeAxis = new DateAxis( timeAxisLabel, TimeZone.getTimeZone( "GMT" ), Locale.getDefault() ); timeAxis.setLowerMargin( 0.02d ); timeAxis.setUpperMargin( 0.02d ); NumberAxis valueAxis = new NumberAxis( valueAxisLabel ); valueAxis.setAutoRangeIncludesZero( false ); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer( true, false ); XYToolTipGenerator toolTipGenerator = StandardXYToolTipGenerator.getTimeSeriesInstance(); renderer.setBaseToolTipGenerator( toolTipGenerator ); XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null); plot.setRenderer( renderer ); boolean addLegend = true; return new JFreeChart( title, JFreeChart.DEFAULT_TITLE_FONT, plot, addLegend ); }
public static void scaleChart(JFreeChart chart, XYSeries dSeries, boolean normalized) { XYPlot plot = (XYPlot) chart.getPlot(); ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setLowerMargin(1.0); domainAxis.setUpperMargin(1.0); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); if (normalized) { domainAxis.setRange(-0.05, 1.05); } else { domainAxis.setRange(dSeries.getMinX() - 1, dSeries.getMaxX() + 1); } NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setRange(-0.1 * Math.sqrt(dSeries.getMaxY()), dSeries.getMaxY() + 0.1 * Math.sqrt(dSeries.getMaxY())); }
plot.getRangeAxis().setLowerMargin(0);
plot.getDomainAxis().setLowerMargin(0); plot.getRangeAxis().setLowerMargin(0);
plot.getRangeAxis().setLowerMargin(0);
axis.setLowerMargin(params.getDouble(prefix + ChartParams.AXIS_LOWER_MARGIN_SUFFIX).doubleValue());
plot.getRangeAxis().setLowerMargin(0);
plot.getDomainAxis().setLowerMargin(0);
plot.getDomainAxis().setLowerMargin(0); plot.getRangeAxis().setLowerMargin(0);
TimeTableXYDataset dataset = createDataset(); ValueAxis xAxis = new DateAxis(); xAxis.setLowerMargin(0.0); xAxis.setUpperMargin(0.0); Calendar lowerBound = getLowerGraphBound();
/** * Constructs a horizontal colorbar axis, using default values where * necessary. * * @param label the axis label. */ public ColorBar(String label) { NumberAxis a = new NumberAxis(label); a.setAutoRangeIncludesZero(false); this.axis = a; this.axis.setLowerMargin(0.0); this.axis.setUpperMargin(0.0); this.colorPalette = new RainbowPalette(); this.colorBarThickness = DEFAULT_COLORBAR_THICKNESS; this.colorBarThicknessPercent = DEFAULT_COLORBAR_THICKNESS_PERCENT; this.outerGap = DEFAULT_OUTERGAP; this.colorPalette.setMinZ(this.axis.getRange().getLowerBound()); this.colorPalette.setMaxZ(this.axis.getRange().getUpperBound()); }
plot.getRangeAxis().setLowerMargin(0);
yAxis.setLowerMargin(0.35); return chart;
timeAxis.setLowerMargin(0.02); // reduce the default margins timeAxis.setUpperMargin(0.02); NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
timeAxis.setLowerMargin(0.02); // reduce the default margins timeAxis.setUpperMargin(0.02); NumberAxis valueAxis = new NumberAxis(valueAxisLabel);