Hi,
Thanks for your email. There exists the following methods for changing the
number formatting (defined in Graph2D):
setNumberFormat (all axes)
setXNumberFormat
setYNumberFormat
Regards,
Mark
----- Original Message ----
From: damiaan_persyn <damiaan.persyn@...>
To: jsci@yahoogroups.com
Sent: Friday, 17 November, 2006 5:00:09 PM
Subject: [jsci] DecimalFormat
Hi;
let me first thank you for this great piece of software, I'm enjoing
testing its possibilities and learning some Java in the course.
Being new at Java this question is probably really dumb, but anyway...
I was trying to get two numbers after the decimal point in a
linegraph, in stead of one. (My data consists of stock option prices,
which tick mostly by 0.05 or 0.01 cents, so that's why.)
My approach so far:
1/ unpacked the jsci-xtra.jar file
2/ downloaded Graph2D.java from cvs and changed line 37 to
protected NumberFormat xNumberFormat = new DecimalFormat("##0.00");
in stead of
protected NumberFormat xNumberFormat = new DecimalFormat("##0.0");
3/ made a new classfile running javac Graph2D.java
4/ ran "jar cf jsci-xtra.jar Jsci", copied the new jsci-xtra.jar file
to /usr/share/java (which is in my $CLASSPATH).
5/ recompiled my applet, restarted my browser.
As this all didn't work started deleting stuff from the ~/.java cache,
robooted, did the above for JGraph2D.java as well, changed all
appearances of .0f to .00f... but all to no good.
So am I wrong in how I changed the code, in the recompilation, or is
there maybe some annoying cache issue keeping the old jar's in use?
Btw, why did I had to change line 28 in Graph2D.java to "public" to
get it compile?
(public Graph2D.DataMarker dataMarker = Graph2D.DataMarker.NONE;)
This number formatting seems pretty hard-coded. I guess a
method for setting it would be a nice feature (at least for me :)
Many thanks,
Damiaan
Yahoo! Groups Links
Send instant messages to your online friends http://uk.messenger.yahoo.com