To create a chart image for JCChart, I use the JCChart snapshot method (JCChart, int), it will return a chart image. Thus, in order to display all the legends, we will have to redefine the snapshot method as follows
( JCChart, int num_legends) {
image = chart.createImage(chart.getSize(). Width, chart.getSize(). Height +
(. Chart.getLegend() getSymbolSize() + 4) * num_legends);
if (image!= null)
{
g = image.getGraphics();
g.setClip(0, 0, chart.getSize(). width,
chart.getSize(). height + chart.getSize(). height +
(chart.getLegend(). getSymbolSize() + 4) * num_legends);
chart.paint();
}
;
}