Jump to content

quality of bar/pie-charts


amit_walinjkar

Recommended Posts

Code:
//The quality of pie-chart is not to what can be expected for a professional tool.
// createBufferedImage when rendered on the report(Image object) and exported to
// pdf does not generate a sharp image, it is rather blurred and lossy.
//Even the 48x48 pix icons appear blurred in the PDF reports.

JFreeChart chart3 = ChartFactory.createPieChart3D("", dataset, true, false, false);
PiePlot3D plot3 = (PiePlot3D) chart3.getPlot();
TextTitle title= new TextTitle();
title.setFont(new Font("Arial", Font.PLAIN,10));
title.setText("Carbon BreakDown Community");
chart3.setTitle(title);
plot3.setLabelPadding(RectangleInsets.ZERO_INSETS);

plot3.setLabelFont(new Font("Arial", Font.PLAIN,8));
plot3.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}={2}"));
plot3.setDepthFactor(0.1);plot3.setCircular(false);//plot3.setStartAngle(270);
plot3.setDirection(Rotation.CLOCKWISE);
plot3.setInsets(RectangleInsets.ZERO_INSETS, true);
chart3.getLegend().setItemFont(new Font("Arial", Font.PLAIN,10));
chart3.getLegend().setItemLabelPadding(RectangleInsets.ZERO_INSETS);
chart3.setBackgroundPaint(Color.LIGHT_GRAY);
Image img = chart3.createBufferedImage(225, 175);

return img;
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...