Scatter chart

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

Scatter chart

Post by Tom » Tue Apr 16, 2002 9:31 pm

I had Scatter charts with two series in 0.7.4 version. Now I upgraded to 0.8.1 and everything works fine except the first series become in small rectangles and the secon one still in shapes. I want them both in shapes.

Does somebody know how to change it?

Thank you.

David Gilbert

Re: Scatter chart

Post by David Gilbert » Tue Apr 16, 2002 9:42 pm

Hi Tom,

Sorry, I was messing around with the code to show someone else how to get different shapes for each series, and the change made it's way into the release! The method that controls the shapes is in the Plot class and is called getShape(...). The code looks like this:

if (series==0) {
return new Rectangle2D.Double(x-0.5*scale, y-0.5*scale, scale, scale);
}
else {
return new Ellipse2D.Double(x-0.5*scale, y-0.5*scale, scale, scale);
}

You should comment out everything except whichever of the two return statements gives you the shape you want.

For those that want different shapes, you could generalise this method some more (as I plan to do in a future version).

Regards,

DG.

Locked