Romoving of unrequired part from the graph

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

Romoving of unrequired part from the graph

Post by vishal » Mon May 20, 2002 8:16 am

Hello Dg &Mudit,


Can i have only the graph area on the screen.
to be clear i would like to have only the the graph area , x-axis and y axis label coordinates on the screen.
i would like to remove the any extra part,like the part associated with the heading part.
this problem is b'coz my home page has a very little space to accomodate graph.is it possible to do that.
please let me know if anything is possible
regards
vishal.

David Gilbert

Re: Romoving of unrequired part from the graph

Post by David Gilbert » Mon May 20, 2002 5:44 pm

You can remove the legend with:

myChart.setLegend(null);

And you can remove any titles with:

myChart.setTitles(new java.util.ArrayList());

I'll probably amend the code so that you can use null instead of the empty list above.

Regards,

DG.

vishal

Re: Romoving of unrequired part from the graph

Post by vishal » Tue May 21, 2002 5:25 am

Hi DG,
Thanks for the instant reply.
but my problem is different.
i would like to remove the background image.
To be more clear the part associated with top of the chart and bottom of the chart.
Once i make the title to null on the top, the background part is still present ,with the color i have choosen on background.
i would like to cut that unnecessary part to fit the chart into my home page.
i hope i'm clear now.
thanking you once again


regards
vishal

David Gilbert

Re: Romoving of unrequired part from the graph

Post by David Gilbert » Wed May 22, 2002 4:39 pm

You can set the plot insets to zero:

Plot plot = chart.getPlot();
plot.setInsets(new Insets(0, 0, 0, 0));

Regards,

DG.

Locked