Anyone know how to get rid of the grey border that appears around bar/ pie charts??
Help appreciated.
Thanks.
grey border
Re: grey border
The following should do it:
PiePlot plot = (PiePlot)chart.getPlot();
plot.setOutlineStroke(null);
Regards,
Dave Gilbert
PiePlot plot = (PiePlot)chart.getPlot();
plot.setOutlineStroke(null);
Regards,
Dave Gilbert
Re: grey border
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);
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);
Re: grey border
Have now found out how to go this with JFreechart method setBackgroundPaint().
Apologies - I am a new user.
Apologies - I am a new user.