I'm creating an web application based on jfreechart, jsp, servlets and ajax.
And sometimes i'm receiving such chart with multiplce labels (i removed any label generator- I'm using default one)

For sure You would like to see a piece of code, so i will give some pieces which should be enough to see the problem.
Everything is based in servlets. Servlet is creating an image and writes it to a stream (like in examples delivered by JFreeCHart).
Code: Select all
public void drawToStream(OutputStream out)
{
//freeGauge is PieChart3D object created earlier.
try
{
ChartUtilities.writeChartAsPNG(out , freeGauge, 500, 500);
}
catch (IOException ioe)
{
//some exception handling
}
}
When i was using only this method everything was working fine (every 30 second i updated the image and it was displayed correctly).
Then i added an image map creation:
Code: Select all
public String getAreaMapString()
{
plot.setToolTipGenerator( new PieToolTipGenerator()
{
public String generateToolTip(PieDataset data, Comparable key)
{
return "'Value: "+ data.getValue(key).toString() +"'," +"OPACITY," + 90 + ",TITLE," + "'"+ key.toString() + "'";
}
});
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
freeGauge.createBufferedImage(500, 500, info);
//MyToolTipTagFragmentGenerator() just override a generateToolTipFragment method.
String imageMap = ChartUtilities.getImageMap("Map", info ,new MyToolTipTagFragmentGenerator(),new StandardURLTagFragmentGenerator());
return imageMap;
}
So:
1. Creating an image - OK.
2. Creating an image map - OK.
3. Creating an image again - Bug.
Can You give me any clues what might be causing this problem?
Thx in advance!