Relocate XY Points ?

A free public discussion forum for the JFreeChart class library.

Relocate XY Points ?

Postby uezi » Tue Feb 21, 2006 10:01 am

Hello,

I'm having a problem with displaying XY points on a XYPlot.
I've got a lot of Points on a similar position (e.g. (3,5) ). Is there a possibility to have them drawn relocated (e.g. point1 at ( 3,5 ); point2 at (3.1,5.0); point3 at (3.1, 5.0) etc. ) ?
Is this functionality already in JFreeChart ? (which renderer ?)

Thanks and best regards,
Uezi
uezi
 
Posts: 9
Joined: Wed Sep 07, 2005 9:27 am
Location: Zurich, Switzerland

Postby david.gilbert » Tue Feb 21, 2006 10:34 am

You would have to modify the values in your dataset, or create a custom renderer.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11358
Joined: Fri Mar 14, 2003 10:29 am

Postby uezi » Tue Feb 21, 2006 10:43 am

Hi David,

Thanks for your fast response.

OK: I'll write my own renderer. From which class would you continue ? StandardXYItemRenderer or XYLineAndShapeRenderer ?
Any input you could give me ?
I'm thinking of put a raster over the chart and relocate the point on this raster, if the original point is already is in use...

Should I post follow ups to the dev-mailing list ?

Best regards,
Uezi
uezi
 
Posts: 9
Joined: Wed Sep 07, 2005 9:27 am
Location: Zurich, Switzerland

Postby david.gilbert » Tue Feb 21, 2006 10:45 am

I think XYLineAndShapeRenderer is a little easier to follow in the source code.

But wouldn't it be a more general solution to write some code that takes any XYDataset and transforms it into another dataset where no (x, y) points are used twice?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11358
Joined: Fri Mar 14, 2003 10:29 am

Postby uezi » Tue Feb 21, 2006 10:51 am

Hmmm... XYDataset transformer... Why not ?
But I think I would need to know what shapes are used to get the relocation-distance and I want to the tooltip to have the orginal (3,5) tag...

So, would you still recommend me the XYDataset-Transformer ?
uezi
 
Posts: 9
Joined: Wed Sep 07, 2005 9:27 am
Location: Zurich, Switzerland


Return to JFreeChart - General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 9 guests