@Override public void customize(JFreeChart chart, ReportParameters reportParameters) { BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer(); renderer.setShadowPaint(Color.LIGHT_GRAY); renderer.setShadowVisible(true); CategoryAxis domainAxis = chart.getCategoryPlot().getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); } }
String fontName = "Lucida Sans"; JFreeChart chart = ChartFactory.createBarChart(null, "", "", dataset, PlotOrientation.VERTICAL, false, true, false ); StandardChartTheme theme = (StandardChartTheme)org.jfree.chart.StandardChartTheme.createJFreeTheme(); theme.setTitlePaint( Color.decode( "#4572a7" ) ); theme.setExtraLargeFont( new Font(fontName,Font.PLAIN, 16) ); //title theme.setLargeFont( new Font(fontName,Font.BOLD, 15)); //axis-title theme.setRegularFont( new Font(fontName,Font.PLAIN, 11)); theme.setRangeGridlinePaint( Color.decode("#C0C0C0")); theme.setPlotBackgroundPaint( Color.white ); theme.setChartBackgroundPaint( Color.white ); theme.setGridBandPaint( Color.red ); theme.setAxisOffset( new RectangleInsets(0,0,0,0) ); theme.setBarPainter(new StandardBarPainter()); theme.setAxisLabelPaint( Color.decode("#666666") ); theme.apply( chart ); chart.getCategoryPlot().setOutlineVisible( false ); chart.getCategoryPlot().getRangeAxis().setAxisLineVisible( false ); chart.getCategoryPlot().getRangeAxis().setTickMarksVisible( false ); chart.getCategoryPlot().setRangeGridlineStroke( new BasicStroke() ); chart.getCategoryPlot().getRangeAxis().setTickLabelPaint( Color.decode("#666666") ); chart.getCategoryPlot().getDomainAxis().setTickLabelPaint( Color.decode("#666666") ); chart.setTextAntiAlias( true ); chart.setAntiAlias( true ); chart.getCategoryPlot().getRenderer().setSeriesPaint( 0, Color.decode( "#4572a7" )); BarRenderer rend = (BarRenderer) chart.getCategoryPlot().getRenderer(); rend.setShadowVisible( true ); rend.setShadowXOffset( 2 ); rend.setShadowYOffset( 0 ); rend.setShadowPaint( Color.decode( "#C0C0C0")); rend.setMaximumBarWidth( 0.1);
renderer.setShadowPaint(Color.LIGHT_GRAY); renderer.setShadowVisible(true); for (int x = 0; x < 5; x++) {
br.setBarPainter(this.barPainter); br.setShadowVisible(this.shadowVisible); br.setShadowPaint(this.shadowPaint);
br.setBarPainter(this.barPainter); br.setShadowVisible(this.shadowVisible); br.setShadowPaint(this.shadowPaint);
barRenderer.setShadowPaint(WidgetUtils.BG_COLOR_BRIGHT); barRenderer.setBarPainter(new StandardBarPainter());