LineAndShapeRenderer workout

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Krac
Posts: 17
Joined: Thu Dec 07, 2006 2:26 pm
Location: Baia Mare, Romania

LineAndShapeRenderer workout

Post by Krac » Mon Jan 28, 2008 9:18 am

Hello everybody :)

Is there any property/workout for a LineAndShapeRenderer to display items belonging to the same category a bit shifted?
What I mean is that if for the underlying CategoryDataset, the RowKeys are identical, to display -though- the items a bit shifted on the Ox axis?

Below is an image that explains better what I want. In this image, there are 5 series, and for each series the items are the same on Ox... can they be shifted within a given range for the Ox axis?


http://img152.imageshack.us/my.php?image=chart1df9.jpg

Thanks for the attention![/url]

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jan 28, 2008 1:28 pm

This feature was introduced in JFreeChart 1.0.7 - call the setUseSeriesOffet(boolean) method in the LineAndShapeRenderer class.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Krac
Posts: 17
Joined: Thu Dec 07, 2006 2:26 pm
Location: Baia Mare, Romania

Post by Krac » Mon Jan 28, 2008 2:30 pm

Brilliant!

Thanks, David :), you made my day.

Can this offset be set somewhere or it has fixed values/formula to establish the shift values?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Jan 28, 2008 6:09 pm

The position is calculated by the getCategorySeriesMiddle() method in the CategoryAxis class (so if you override that method you can control the offset yourself).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked