Question on SymbolicAxis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
QC_Jfreeuser
Posts: 2
Joined: Wed Aug 27, 2003 1:52 am

Question on SymbolicAxis

Post by QC_Jfreeuser » Wed Aug 27, 2003 2:04 am

Hello
I upgraded to .9.11 from .9.6 and the move was fairly straightforward.
I was using VerticalSymbolicAxis for my Y axis and used a String[] to display values instead of numeric values.
String [] data;
m_rangeAxis = new VerticalSymbolicAxis(RANGEAXIS_TITLE, data);
In .9.11 I moved to
m_rangeAxis = new SymbolicAxis(RANGEAXIS_TITLE, data);
and the Y axis displays numeric values - 0,1,2,3, 4 instead of my strings.
Reading the SymbolicValues returns the correct String array but the display isnt working.
String[] test = m_rangeAxis.getSymbolicValue();

Any thoughts on what Im missing ? Help appreciated.
Thanks

Karthicks
Posts: 20
Joined: Wed Mar 26, 2003 1:29 pm
Location: Chennai , India

Post by Karthicks » Wed Aug 27, 2003 7:37 am

Hi,
this is an breakage already reported by me. It has benn fixed in CVS.

Refer the reply in below link,

http://www.jfree.org/phpBB2/viewtopic.php?p=15420#15420

S.Karthick

QC_Jfreeuser
Posts: 2
Joined: Wed Aug 27, 2003 1:52 am

Post by QC_Jfreeuser » Wed Aug 27, 2003 7:25 pm

Karthicks,
Thanks for the response. what files do I need to pull from CVS ?
I looked at the diff of SymbolicAxis,Number, Value and Axis classes and none of the diffs seem to be related to YisSymbolic interface.
Thanks

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 Aug 27, 2003 7:35 pm

This is the fix:

http://cvs.sourceforge.net/cgi-bin/view ... 1.6&r2=1.7

It was just the method signature hadn't been updated to reflect changes elsewhere.
David Gilbert
JFreeChart Project Leader

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

Guest

Post by Guest » Tue Oct 21, 2003 8:34 am

The SymbolicAxis isn't quite fixed - there seems to be a lot of overlapping code with NumberAxis that hasn't been properly updated. This means that the SymbolicAxis ignores any axis-offset in the plot, resulting in its text overlapping the axis line/ticks if any axis offset is used.

The quick'n' dirty fix is to copy the refreshTicksHorizontal/refreshTicksVertical from NumberAxis, and replace the

Code: Select all

    tickLabel = getTickUnit().valueToString(currentTickValue);

with

Code: Select all

   tickLabel = valueToString(currentTickValue);
This also allows you to remove the refreshTicks() override completly.

Now, a prettier solution would be to introduce an overridable method in NumberAxis wrapping the replaced line... would reduce the amount of copy-paste code in SymbolicAxis.

Locked