Remove Chart's gray border
-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
Remove Chart's gray border
How to remove the chart's gray border? To make the output more nicer.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Is the grey border just the chart's background paint? Try:
Code: Select all
chart.setBackgroundPaint(Color.white);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
It works for Multiple Pie Chart.
var chart = plot.getPieChart();
chart.getPlot().setOutlinePaint(null);
The above works for Multiple Pie Chart. How about Line Chart?
chart.getPlot().setOutlinePaint(null);
The above works for Multiple Pie Chart. How about Line Chart?
-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
any solutions?
Any solutions for LineChart?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It depends what this "border" is? If it is the plot's outline, try:
Code: Select all
chart.getPlot().setOutlineVisible(false);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
remove the x & y-axis gray line
Thanks, the above works.
How about removing the horizontal & vertical gray line for the x & y-axis.
How about removing the horizontal & vertical gray line for the x & y-axis.
-
- Posts: 5
- Joined: Fri Oct 26, 2007 8:02 pm
Removing Axis Lines...
Try this for the axis:
chart.getXYPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
chart.getXYPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
ValueAxis y2 = jFreeChart.getXYPlot().getRangeAxis(1);
if(y2 != null){
y2.setAxisLinePaint(Color.WHITE);
}
It does not really remove them as much as set them to white.. so if you have a different plot background paint.. you might want to match...
chart.getXYPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
chart.getXYPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
ValueAxis y2 = jFreeChart.getXYPlot().getRangeAxis(1);
if(y2 != null){
y2.setAxisLinePaint(Color.WHITE);
}
It does not really remove them as much as set them to white.. so if you have a different plot background paint.. you might want to match...
Thanks,
Rafid
Rafid