How to set the size of shape?

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

How to set the size of shape?

Post by aurorean » Tue Feb 18, 2003 10:06 am

How to set or get the size of shape in StandardXYItemRenderer?

Arnaud

Re: How to set the size of shape?

Post by Arnaud » Tue Feb 18, 2003 2:08 pm

Hello,

There were some dedicated methods in the version 0.9.4, including the setDefaultShapeScale(double scale) of the StandardXYItemRenderer class.

The method has disapeared in version 0.9.6 and the related code has been put in comments. I did not had time for looking further on that subject, but I guess David had some good reasons for that. He will certainly give us some more info to know :
- if it there were some bugs he did not had time to fix
- if he thought the methods were not used
- if he had plan to rewrite these functionality in an other way... but had not the time for that

Regards,
Arnaud

David Gilbert

Re: How to set the size of shape?

Post by David Gilbert » Tue Feb 18, 2003 4:04 pm

The scaling is gone, it just happened as I was recoding everything to support dual axes/datasets/renderers. It can probably be put back in fairly easily.

There is a setShape(...) method in the AbstractRenderer class that allows you to set the Shape that will be used for a series. You specify the dataset index (0 for primary dataset, 1 for secondary dataset), the series index and the shape. The shape can be any instance of Shape, but you should make sure that (0,0) is roughly in the middle of the shape (because the code translates the shape to (x, y))...the other dimensions don't matter.

Regards,

DG

Locked