Remove border around chart
Remove border around chart
I have a chart that has a border all around it. I want to remove 2 lines (the top and right) but leave the left and bottom because they represent the axis'. Any ideas on how to do this? Thanks,
Kenny
Kenny
Remove top and right axis lines
Is it possible to do this?
James
James
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Try:
Code: Select all
plot.setOutlinePaint(null);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 1
- Joined: Wed Jan 25, 2006 3:52 pm
This is fine for plots, but how can I remove the border from around a pie chart? I have successfully removed the border around the chart and title together by using setBorderVisible(false), but there is still a border around the pie chart itself which I can't seem to get rid of.
Any help will be greatly appreciated!
Thanks,
Justin
Any help will be greatly appreciated!
Thanks,
Justin
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Maybe you need to make the chart background paint the same as the plot background paint:
Code: Select all
chart.setBackgroundPaint(plot.getBackgroundPaint());
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


I don't have a plot - only a pie chart. I do this...
...and that gives me a light gray border. If I setBorderVisible(true), then I get a border around the chart and title both, so it seems that that method affects the outer border around everything but has no affect on the box around the pie chart itself. I need something which will turn off the box around the chart - whether I completely disable it or just make it Color.white as well...
Thanks,
Justin
Code: Select all
chart.setBackgroundPaint(Color.white);
chart.setBorderVisible(false);
Thanks,
Justin
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Try this:
Code: Select all
PiePlot plot = (PiePlot) chart.getPlot();
plot.setOutlinePaint(null);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

