Help requested

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bonododo
Posts: 9
Joined: Wed Mar 17, 2004 5:27 pm

Help requested

Post by bonododo » Wed Mar 17, 2004 5:32 pm

First of all i would like to thanks the all team of Jfreechart which has made a wonderful job. I unfortunatly just dicovered this library one week ago...

I just wanted to know how to plot a non linear XYplot.

for example i would like to plot a square with those coordonates:

(-1,-1) (1,-1)(1,1)(-1,1)! see what i mean???

unfortunatly Jfreechart doesn t seem to do that! maybe i didn t look on the right place, but i don t think so.

So my question was: Is it possible? and if not which part of the library should i develop to make it possible?


thanks in advance, and another time for your really GREAT job.


long life to JfreeChart

zany
Posts: 20
Joined: Mon Mar 15, 2004 2:36 pm
Location: Germany

Solid geometry

Post by zany » Wed Mar 17, 2004 6:42 pm

Hi,

you need to write a (XY) renderer to superimpose solid geometry over charts.
For some fixed shape that is an easy one.

Have a look at e.g. LineAndShapeRenderer and hack upon the draw(...) method.

If you want to draw the shape according to some dataset it could be difficult writing a custom dataset that adheres to XYDatasets contract.

cu,
Christian

jdemumbr

Post by jdemumbr » Wed Mar 17, 2004 8:47 pm

doesn't the normal xy plot do a "connect-the-dots" rendering? try adding the points with the first one at the end also so it reads (-1,-1) (1,-1) (1,1) (-1,1) (-1,-1) so it draws that last side.

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 » Wed Mar 17, 2004 11:50 pm

jdemumbr wrote:doesn't the normal xy plot do a "connect-the-dots" rendering? try adding the points with the first one at the end also so it reads (-1,-1) (1,-1) (1,1) (-1,1) (-1,-1) so it draws that last side.
That is the approach I would use, but note that the XYSeries class sorts items by x-values, so you'll need to modify that or write your own XYDataset implementation.
David Gilbert
JFreeChart Project Leader

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

zany
Posts: 20
Joined: Mon Mar 15, 2004 2:36 pm
Location: Germany

Polygons

Post by zany » Fri Mar 19, 2004 11:35 am

Hi,

Davids idea is neat. The x-value sorting is the thing that stops one from doing arbitrary shapes -- so just replace the dataset and keep the renderer.

User raghu has a more detailed shape example in the thread "Ploygons on XYplot..REPLY ASAP".

cu,
Christian

Guest

Re: Polygons

Post by Guest » Fri Mar 19, 2004 11:38 am

zany wrote:Hi,

Davids idea is neat. The x-value sorting is the thing that stops one from doing arbitrary shapes -- so just replace the dataset and keep the renderer.

User raghu has a more detailed shape example in the thread "Ploygons on XYplot..REPLY ASAP".

cu,
Christian

thanks for your support it s great, but could you plz tell me where i can find that fuc**** x-value sorting thing if you know that.



cu and plot good graphs

bonododo
Posts: 9
Joined: Wed Mar 17, 2004 5:27 pm

Post by bonododo » Fri Mar 19, 2004 2:29 pm

I ve found 2 java class made by V. Molokoov to plot polygones. If you want i can ask him if i can give it away. I tried it and it s very uselful i could really easyly plot a square!!!

If your interested, plz send me a mail : thomas_rien@hotmail.com

Locked