Set Chart X and Y axis as if it is rotated by 90 degrees??

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Set Chart X and Y axis as if it is rotated by 90 degrees??

Post by hsp707 » Thu May 15, 2008 5:57 pm

I am using JSF chart creator to create a XY line chart. It is working fine and thanks to the creator.
But I am facing one problem. If I use the tag as it is as described in the documentation, I get the chart as shown in Chart1
But I need to display the chart as shown in Chart2 Is there any way to achieve that using the tags of chart creator OR should I be using JFree chart API.

In other words, this is the layout that I have

(Chart1)

|
-
|
-
|
-
|_|___|____|___|
0

And I want to have layout like the below: - (Chart2)

0 _|___|____|___|
|
-
|
-
|
-
|

Thanks a lot.

hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Post by hsp707 » Thu May 15, 2008 8:13 pm

no reply :-?

Anybody, please ..........

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 » Thu May 15, 2008 8:24 pm

hsp707 wrote:no reply :-?
You waited a whole 2 hours and 16 minutes before asking?

The method you need is (in JFreeChart):

Code: Select all

public void setRangeAxisLocation(AxisLocation location);
I don't know how you do that from JSF chart creator.
David Gilbert
JFreeChart Project Leader

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

hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Post by hsp707 » Thu May 15, 2008 9:49 pm

Thanks David. I think I should get into JFreechart and try to understand it more. I know there are so many more options that I can use and leverage it to display whichever way I want. I admit that I was trying to find a shortcut by using chart creator :) ....... looks like time to do some effort and learn JFreechart.

hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Post by hsp707 » Fri May 23, 2008 6:43 pm

Thanks David,

Now I got it showing up like the way I wanted using setRangeAxisLocation as you said.

But now I have another problem, the chart is being displayed top-left but the values for axis ranges are not the way I want. In other words, it is being displayed as

0 10 20 30
_| _|___|____|___|
30|
|
20-
|
10-
|
0 -

But I want both axis range values to display like shown below: -

0 10 20 30
_| _|___|____|___|
0|
|
10-
|
20-
|
30 -

They should both start from 0 and increment from there.

Thanks again.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Fri May 23, 2008 7:29 pm

Look for this method in the docs

Code: Select all

public void setInverted(boolean flag)

hsp707
Posts: 18
Joined: Thu May 15, 2008 4:58 pm

Post by hsp707 » Fri May 23, 2008 8:02 pm

thanks skunk

It worked.

Locked