Shift the origin from (0,0) to (0,-3)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
parth.9365
Posts: 2
Joined: Thu Apr 19, 2012 4:18 am
antibot: No, of course not.

Shift the origin from (0,0) to (0,-3)

Post by parth.9365 » Thu Apr 19, 2012 4:35 am

Currently, Its like :Image

It Should be like: Image

Currently when i run this code it shows me a graph as shown above, i want to draw a graph that i've shown. Currently its drawing a graph symmetric about the (0,0), I think making it drawn from (0,-3) or (0, < -2) should do the work. Is there any other way for doing this?

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Shift the origin from (0,0) to (0,-3)

Post by matinh » Thu Apr 19, 2012 1:44 pm

What kind of renderer are you using? The XYAreaRenderer?

It seem this renderer currently doesn't support to set an "offset". If you want to implement it yourself, subclass the renderer and override the drawItem() method. It's basically just replacing "0.0" in the lines 537 and 563 with the actual offset.
Please consider providing a patch if you implement it.

hth,
- martin

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Shift the origin from (0,0) to (0,-3)

Post by John Matthews » Thu Apr 19, 2012 9:58 pm

Cross-posted here; possible approach suggested here.

Locked