How to do a chart with this data?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Arkkimaagi
Posts: 25
Joined: Wed Jun 09, 2004 6:15 am
Location: Helsinki, Finland
Contact:

How to do a chart with this data?

Post by Arkkimaagi » Tue Jul 05, 2005 11:27 am

If I need to show string values on the x-axis and yet I need to have values with identical x-values, how can this be done?

I tried category axis, but it only shows 6 values, and the last two do not appear.

How can I force JFreeChart to use the values I give in the order I give them without overwriting the old values?

Code: Select all

 x  |  y
----+----
01a | 10.5
02a | 5.4
03a | 6.8
04a | 3.5
05a | 5.5
abc | 5.0
01a | 3.0
02a | 5.8
~ Arkkimaagi ~
Experto Credite

Arkkimaagi
Posts: 25
Joined: Wed Jun 09, 2004 6:15 am
Location: Helsinki, Finland
Contact:

Post by Arkkimaagi » Tue Jul 05, 2005 2:13 pm

This is the only solution I've been able to find, and It's not pretty. There must be a better way..

http://www.jfree.org/phpBB2/viewtopic.php?t=9407
~ Arkkimaagi ~
Experto Credite

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 » Tue Jul 05, 2005 5:31 pm

You could use the SymbolicAxis class for the domain axis on an XYPlot. Your x-values would become 0, 1, 2, 3 ... and you'd set strings in the SymbolicAxis class as "01a", "01b", etc. I'm not sure how someone looking at the chart would know the value of "01a" though, is it 10.5 or 3.0?
David Gilbert
JFreeChart Project Leader

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

Arkkimaagi
Posts: 25
Joined: Wed Jun 09, 2004 6:15 am
Location: Helsinki, Finland
Contact:

Post by Arkkimaagi » Wed Jul 06, 2005 6:36 am

Well, our client wants to see the hours, and some of the hours need to have working-shift info next to them, a being a short for team a.

Hmm, symbolic axis could work, but it's a damn shame that 3d-charts work better on category axis.

What if there would be an easy method to hide labels and show sublabels instead? This way I could create the category axis a bit like symbolic axis, but in category mode with better 3d support?
~ Arkkimaagi ~
Experto Credite

Locked