/** * Sets the location of the range axis and, if requested, sends a * {@link PlotChangeEvent} to all registered listeners. * * @param location the location (<code>null</code> not permitted). * @param notify notify listeners? * * @see #setDomainAxisLocation(AxisLocation, boolean) */ public void setRangeAxisLocation(AxisLocation location, boolean notify) { setRangeAxisLocation(0, location, notify); }
/** * Sets the location of the range axis and, if requested, sends a * {@link PlotChangeEvent} to all registered listeners. * * @param location the location ({@code null} not permitted). * @param notify notify listeners? * * @see #setDomainAxisLocation(AxisLocation, boolean) */ public void setRangeAxisLocation(AxisLocation location, boolean notify) { setRangeAxisLocation(0, location, notify); }
/** * Sets the location of the range axis and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param location the location (<code>null</code> not permitted). * * @see #setRangeAxisLocation(AxisLocation, boolean) * @see #setDomainAxisLocation(AxisLocation) */ public void setRangeAxisLocation(AxisLocation location) { // defer argument checking... setRangeAxisLocation(location, true); }
/** * Sets the location for a range axis and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param index the axis index. * @param location the location. * * @see #getRangeAxisLocation(int) * @see #setRangeAxisLocation(int, AxisLocation, boolean) */ public void setRangeAxisLocation(int index, AxisLocation location) { setRangeAxisLocation(index, location, true); }
/** * Sets the location of the range axis and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param location the location ({@code null} not permitted). * * @see #setRangeAxisLocation(AxisLocation, boolean) * @see #setDomainAxisLocation(AxisLocation) */ public void setRangeAxisLocation(AxisLocation location) { // defer argument checking... setRangeAxisLocation(location, true); }
/** * Sets the location for a range axis and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param index the axis index. * @param location the location. * * @see #getRangeAxisLocation(int) * @see #setRangeAxisLocation(int, AxisLocation, boolean) */ public void setRangeAxisLocation(int index, AxisLocation location) { setRangeAxisLocation(index, location, true); }
// get plot from chart object CategoryPlot plot = (CategoryPlot) chart.getPlot(); // move axis to right side of chart plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
public class myCustomizer implements JRChartCustomizer { public void customize(JFreeChart chart, JRChart jasperChart) { CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); } }
CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setOrientation(PlotOrientation.HORIZONTAL); MinMaxCategoryRenderer renderer = new MinMaxCategoryRenderer(); plot.setRenderer(renderer); plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
public static void setupPlot(CategoryPlot plot) { plot.setBackgroundPaint(ChartDefaults.transparent); plot.setOutlinePaint(ChartDefaults.transparent); plot.setRangeGridlinePaint(ChartDefaults.gridLineColor); plot.setRangeGridlineStroke(new BasicStroke(0.5f)); plot.setRangeGridlinesVisible(true); plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation); plot.setDomainGridlinesVisible(false); ChartUtil.setupRangeAxis(plot.getRangeAxis()); ChartUtil.setupDomainAxis(plot.getDomainAxis()); }
public static void setupPlot(CategoryPlot plot) { plot.setBackgroundPaint(ChartDefaults.transparent); plot.setOutlinePaint(ChartDefaults.transparent); plot.setRangeGridlinePaint(ChartDefaults.gridLineColor); plot.setRangeGridlineStroke(new BasicStroke(0.5f)); plot.setRangeGridlinesVisible(true); plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation); plot.setDomainGridlinesVisible(false); ChartUtil.setupRangeAxis(plot.getRangeAxis()); ChartUtil.setupDomainAxis(plot.getDomainAxis()); }
public JFreeChart createLayeredBarChart(String title, String domainLabel, String rangeLabel, CategoryDataset dataset) { JFreeChart chart = ChartFactory.createBarChart(title, domainLabel, rangeLabel, dataset, PlotOrientation.HORIZONTAL, true, true, false); chart.setBackgroundPaint(Color.white); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinePaint(Color.white); plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); ExtendedCategoryAxis domainAxis = new ExtendedCategoryAxis(null); domainAxis.setTickLabelFont(new Font("SansSerif", Font.BOLD, 12)); domainAxis.setCategoryMargin(0.20); //domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); plot.setDomainAxis(domainAxis); LayeredBarRenderer renderer = new LayeredBarRenderer(); renderer.setDrawBarOutline(false); plot.setRenderer(renderer); plot.setRowRenderingOrder(SortOrder.DESCENDING); GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64)); renderer.setSeriesPaint(0, gp0); GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0)); renderer.setSeriesPaint(1, gp1); GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, new Color(64, 0, 0)); renderer.setSeriesPaint(2, gp2); return chart; }
axis.setAxisLineVisible(false); plot.setRangeAxis(xAxisCount, axis); plot.setRangeAxisLocation(xAxisCount, AxisLocation.BOTTOM_OR_LEFT); axes.add(axis); GValueAxis axis = new GValueAxis(); plot.setRangeAxis(xAxisCount, axis); plot.setRangeAxisLocation(yAxisCount, AxisLocation.TOP_OR_LEFT); axes.add(axis);
axis.setAxisLineVisible(false); plot.setRangeAxis(yAxisCount, axis); plot.setRangeAxisLocation(yAxisCount, AxisLocation.BOTTOM_OR_LEFT); axes.add(axis); GValueAxis axis = new GValueAxis(); plot.setRangeAxis(yAxisCount, axis); plot.setRangeAxisLocation(yAxisCount, AxisLocation.BOTTOM_OR_RIGHT); axes.add(axis);
/** * Utility method to set the default style of the Gantt Charts * * @param chart {@link JFreeChart} to style */ private static void setGanttChartDefaults(JFreeChart chart) { ChartUtil.setDefaults(chart); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT); // renderer BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setBaseItemLabelFont(ChartDefaults.defaultFont); renderer.setBaseItemLabelPaint(ChartDefaults.axisLabelColor); for (int j = 0; j < ChartDefaults.darkColors.length; j++) { renderer.setSeriesPaint(j, ChartDefaults.darkColors[j]); } }
(Double) tupleFinder.getMaximum(i)); if (i > 0) { plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); plot.setOrientation(PlotOrientation.HORIZONTAL);
setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);
plot.setRangeAxisLocation( 1, AxisLocation.BOTTOM_OR_RIGHT );