Draw chart uder Windows and Linux without X Server

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Everhood
Posts: 4
Joined: Thu Dec 18, 2008 8:46 am
Location: Minsk, Belarus

Draw chart uder Windows and Linux without X Server

Post by Everhood » Thu Dec 18, 2008 9:35 am

Hello all,

JFreeChart 1.0.11

Enviroment:
Server: Linux 8.0, tomcat5, no X Server started.

Image

Windows
Image

How can I get same draw quality on Linux?

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 » Thu Dec 18, 2008 9:52 am

The output from Linux looks like it doesn't have antialiasing enabled. Not sure why that would be. Which Java runtime are you using?
David Gilbert
JFreeChart Project Leader

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

Everhood
Posts: 4
Joined: Thu Dec 18, 2008 8:46 am
Location: Minsk, Belarus

Post by Everhood » Thu Dec 18, 2008 9:55 am

java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b21)
IcedTea Server VM (build 1.7.0-b21, mixed mode)

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 Dec 18, 2008 10:10 am

OK, IceTea is based on OpenJDK but with the "binary blob" (non-open source code) removed and replaced with Free / Open Source alternatives. I think that the Java2D rendering is one area that Sun wasn't able to fully "open source" (because code was licensed from a third party) so there is some new Java2D code in there...so I guess what you are seeing is could be a bug in the new implementation. Their bug tracker is here if you want to report it:

http://icedtea.classpath.org/bugzilla/query.cgi

When I find some time, I'd like to get up to speed with IcedTea so I can make sure JFreeChart runs nicely on it. Hopefully I'll do that before the FOSDEM conference in Brussels in February (where many of the OpenJDK, GNU Classpath and IcedTea developers meet).
David Gilbert
JFreeChart Project Leader

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

Everhood
Posts: 4
Joined: Thu Dec 18, 2008 8:46 am
Location: Minsk, Belarus

Post by Everhood » Thu Dec 18, 2008 10:39 am

Thanks for quick answer, I'll try to install java from SUN.

Everhood
Posts: 4
Joined: Thu Dec 18, 2008 8:46 am
Location: Minsk, Belarus

Post by Everhood » Thu Dec 18, 2008 5:47 pm

After installing

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)

drawing is OK.

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Thu Dec 18, 2008 6:40 pm

Actually, the JDK never made a claim that a certain default anti-aliasing setting is required. The defaults changed in the past and in most cases, they are purely platform dependent.

If you tell your Windows-System (or Linux, does not matter) to not perform any aliasing on graphics and fonts, you probably want your JDK to obey to that rule. At least on Windows, the JDK uses whatever you define as system-default in the control panel. For Linux, things are a bit more difficult thanks to a insane X11-Server API (or no X11-Server at all).

Therefore I would not claim it a JDK bug. You probably should provide a sensible default in your code.

@see http://java.sun.com/javase/6/docs/api/j ... rties.html
@see http://java.sun.com/javase/6/docs/techn ... flags.html

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 Dec 18, 2008 7:50 pm

Taqua wrote:Therefore I would not claim it a JDK bug. You probably should provide a sensible default in your code.
JFreeChart sets the anti-aliasing hint by default. It's only a hint, so I guess a JRE could ignore it and still be compliant with the Java specification, but I'd still consider this a bug. Anyway, I'll dig deeper into IcedTea / OpenJDK soon and find out for sure...
David Gilbert
JFreeChart Project Leader

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

Locked