grey border

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
james hart

grey border

Post by james hart » Fri Mar 01, 2002 4:41 pm

Anyone know how to get rid of the grey border that appears around bar/ pie charts??

Help appreciated.
Thanks.

David Gilbert

Re: grey border

Post by David Gilbert » Fri Mar 01, 2002 7:04 pm

The following should do it:

PiePlot plot = (PiePlot)chart.getPlot();
plot.setOutlineStroke(null);

Regards,

Dave Gilbert

james hart

Re: grey border

Post by james hart » Mon Mar 04, 2002 12:20 pm

Dave,
Thankyou for your swift repsonse. I have tried the code you supplied but alas the grey borders are still there. Could this be a bug?

Here is the main bit of my code:

// series names usually null for pie chart
CategoryDataset cds = new DefaultCategoryDataset( null,seriesNames, dataValues);
PieDataset pieDataset = Datasets.createPieDataset(cds, 0);

chart = ChartFactory.createPieChart(graph.getTitle(), pieDataset, false);

PiePlot plot = (PiePlot)chart.getPlot();

plot.setOutlineStroke(null); //change??


BufferedImage myImage = new BufferedImage(graph.getImageSizeX(), graph.getImageSizeY(), BufferedImage.TYPE_INT_RGB);

Graphics2D g2 = myImage.createGraphics();

chart.draw(g2, new Rectangle2D.Double(0, 0, graph.getImageSizeX(), graph.getImageSizeY()),null);

james hart

Re: grey border

Post by james hart » Mon Mar 04, 2002 1:02 pm

Have now found out how to go this with JFreechart method setBackgroundPaint().

Apologies - I am a new user.

Locked