@Override public double getCategoryStart(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) - calculateCategorySize(categoryCount, area, edge) / 2; } }
plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
/** * Sets properties common to all category graphs of this plug-in. * * @param plot * the chart to set the properties for */ protected void setCategoryPlotProperties(final CategoryPlot plot) { plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); setPlotProperties(plot); }
/** * Sets properties common to all category graphs of this plug-in. * * @param plot * the chart to set the properties for */ protected void setCategoryPlotProperties(final CategoryPlot plot) { plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); setPlotProperties(plot); }
@Override public double getCategoryEnd(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) + calculateCategorySize(categoryCount, area, edge) / 2; }
protected JFreeChart createGraph() { final CategoryDataset dataset = createDataSet().build(); final JFreeChart chart = ChartFactory.createLineChart( _graphTitle, // title "Build Number #", // category axis label _unit, // value axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); chart.setBackgroundPaint( Color.white ); final CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis domainAxis = new ShiftedCategoryAxis( null ); plot.setDomainAxis( domainAxis ); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_90 ); domainAxis.setLowerMargin( 0.0 ); domainAxis.setUpperMargin( 0.0 ); domainAxis.setCategoryMargin( 0.0 ); final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); renderer.setBaseStroke( new BasicStroke( 3.0f ) ); ColorPalette.apply( renderer ); return chart; } }
@Override public double getCategoryStart(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) - calculateCategorySize(categoryCount, area, edge) / 2; } }
categoryPlot.setRangeGridlinePaint(Color.black); categoryPlot.setDrawingSupplier(Plot.SUPPLIER); CategoryAxis domainAxis = new ShiftedCategoryAxis(Messages.Plot_Build()); categoryPlot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
@Override public double getCategoryStart(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) - calculateCategorySize(categoryCount, area, edge) / 2; } }
plot.setRangeGridlinePaint(Color.darkGray); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); domainAxis.setLowerMargin(0.0);
@Override public double getCategoryEnd(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) + calculateCategorySize(categoryCount, area, edge) / 2; }
CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
@Override public double getCategoryEnd(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) + calculateCategorySize(categoryCount, area, edge) / 2; }
plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
@Override public double getCategoryStart(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) - calculateCategorySize(categoryCount, area, edge) / 2; } }
plot.setRangeGridlinesVisible(true); plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
@Override public double getCategoryStart(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) - calculateCategorySize(categoryCount, area, edge) / 2; } }
CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
@Override public double getCategoryEnd(int category, int categoryCount, Rectangle2D area, RectangleEdge edge) { return super.getCategoryStart(category, categoryCount, area, edge) + calculateCategorySize(categoryCount, area, edge) / 2; }
plot.setRangeGridlinePaint(Color.black); CategoryAxis domainAxis = new ShiftedCategoryAxis(null); plot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);