Remove border around chart

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

Remove border around chart

Post by kdubuisson » Fri Jun 13, 2003 2:45 pm

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

jmc
Posts: 2
Joined: Thu Jan 05, 2006 2:30 pm

Remove top and right axis lines

Post by jmc » Thu Jan 05, 2006 2:33 pm

Is it possible to do this?

James

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Jan 06, 2006 6:10 pm

Try:

Code: Select all

plot.setOutlinePaint(null);
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jmc
Posts: 2
Joined: Thu Jan 05, 2006 2:30 pm

Post by jmc » Sat Jan 07, 2006 12:58 pm

david.gilbert wrote:Try:

Code: Select all

plot.setOutlinePaint(null);
thanks that works fine.

James

JustinAshworth
Posts: 1
Joined: Wed Jan 25, 2006 3:52 pm

Post by JustinAshworth » Wed Jan 25, 2006 3:54 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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jan 26, 2006 11:23 am

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Guest

Post by Guest » Thu Jan 26, 2006 2:45 pm

I don't have a plot - only a pie chart. I do this...

Code: Select all

chart.setBackgroundPaint(Color.white);
chart.setBorderVisible(false);
...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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jan 26, 2006 3:07 pm

Try this:

Code: Select all

PiePlot plot = (PiePlot) chart.getPlot();
plot.setOutlinePaint(null);
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

rbutta
Posts: 2
Joined: Wed Jul 19, 2006 6:18 am

Post by rbutta » Wed Jul 19, 2006 6:20 am

plot.setOutlinePaint(java.awt.Color.white);

Locked