Vertical label overlaps axes

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Marilyn Linton

Vertical label overlaps axes

Post by Marilyn Linton » Sat Sep 01, 2001 5:06 am

The demo that I downloaded with JFreeChart has the vertical labels overlapping the y-axis tick numbers in XY plots (I am running on a PC with Windows 98). This also occurs in my XY plots in my application.
Is there any way to avoid this.
Thank-you, Marilyn

David Gilbert

RE: Vertical label overlaps axes

Post by David Gilbert » Mon Sep 17, 2001 3:03 pm

Hi Marilyn,

Sorry to hear that you are having trouble with JFreeChart.

It would help me to diagnose the problem if you could send me a screen copy of the chart showing the problem (PNG/GIF/JPEG or whatever) and also some details of the Java Virtual Machine version you are running (the demo program includes a frame that displays all the information - just copy and paste that if you can).

Regards,

DG.

Frank Stanbach

RE: Vertical label overlaps axes

Post by Frank Stanbach » Sun Oct 07, 2001 2:25 pm

It must be 1.4beta 2 or windows 2000

Frank


awt.toolkit sun.awt.windows.WToolkit
file.encoding Cp1252
file.encoding.pkg sun.io
file.separator \
java.awt.fonts
java.awt.graphicsenv sun.awt.Win32GraphicsEnvironment
java.awt.printerjob sun.awt.windows.WPrinterJob
java.class.path jfreechart.jar
java.class.version 48.0
java.ext.dirs C:\Program Files\JavaSoft\JRE\1.4\lib\ext
java.home C:\Program Files\JavaSoft\JRE\1.4
java.io.tmpdir C:\DOCUME~1\FRANKS~1\LOCALS~1\Temp\
java.library.path C:\WINNT\system32;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM;c:\java\jdk1.4\bin;C:\PROGRA~1\F-Secure\SSHTRI~1\Program;C:\PalmDev\pilrc-2.7b;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin;C:\cygnus\PRC-Tools\H-i586-cygwin32\bin
java.runtime.name Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version 1.4.0-beta2-b77
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.4
java.util.prefs.PreferencesFactory java.util.prefs.WindowsPreferencesFactory
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version 1.4.0-beta2
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) Client VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 1.4.0-beta2-b77
line.separator


os.arch x86
os.name Windows 2000
os.version 5.0
path.separator ;
sun.arch.data.model 32
sun.boot.class.path C:\Program Files\JavaSoft\JRE\1.4\lib\rt.jar;C:\Program Files\JavaSoft\JRE\1.4\lib\i18n.jar;C:\Program Files\JavaSoft\JRE\1.4\lib\sunrsasign.jar;C:\Program Files\JavaSoft\JRE\1.4\lib\jsse.jar;C:\Program Files\JavaSoft\JRE\1.4\lib\jce.jar;C:\Program Files\JavaSoft\JRE\1.4\lib\charsets.jar;C:\Program Files\JavaSoft\JRE\1.4\classes
sun.boot.library.path C:\Program Files\JavaSoft\JRE\1.4\bin
sun.cpu.endian little
sun.cpu.isalist pentium i486 i386
sun.io.unicode.encoding UnicodeLittle
sun.os.patch.level
user.country US
user.dir C:\java\Chart\jfreechart-0.5.6
user.home C:\Documents and Settings\Frank Stanbach
user.language en
user.name Frank Stanbach
user.timezone America/Los_Angeles
user.variant

Dogbert

RE: Vertical label overlaps axes

Post by Dogbert » Mon Oct 08, 2001 4:04 pm

The problem exhibits itself with JVM 1.3.0_02 (ships w/JBuilder5).

Works fine under 1.3.0-C and J2RE 1.3.0 IBM build ca130-20010330 (AIX).

Asha

RE: Vertical label overlaps axes

Post by Asha » Tue Feb 05, 2002 6:52 pm

I face the same problem with the demo (jfreechart-0.7.1). I have JBuilder5 on Win2000 machine.
Is there a workaround for this?

(I can e-mail the image is you would like.)

Thanks in advance.

Dogbert

RE: Vertical label overlaps axes

Post by Dogbert » Tue Feb 05, 2002 8:04 pm

The hack we came up with was in com.jrefinery.chart.VerticalNumberAxis's draw method. After it defines 'xx' in the 'if (verticalLabel) {' block we put:

// hack around a bug in JBuilder5's JDK:
String version = System.getProperty("java.version");
if (version.equals("1.3.0_02") || version.startsWith("1.4"))
xx -= labelBounds.getHeight() / 2;

Note that I don't know if this works with the latest version....

Locked