Hello everybody,
first of all, a big thank you to David Gilbert and the other developers for this useful and flexible package.
I have a question regarding antialiasing: The online demos such as the ParetoChart demo shown on the jfree webpage under http://www.jfree.org/jfreechart/images/ ... rtDemo.png show correct antialiasing: zooming in, I noticed that the percentage line is antialiased while the bars aren't (there is also no need to). The source code of the demo does not set any special parameter in this regard.
However, on my machine, I have tested various antialiasing parameters (via RenderingHints) to no avail: I could not find a way to get this antialiasing behaviour on Apple's JDK 1.4.1 running Mac OS X. I did not have a chance to test my code on another platform, but I can either disable antialiasing as a whole, enable it for fonts only or antialias everything (where everything means that straight lines such as the border lines of bars will also have antialiasing for no real reason).
Is there anything I can do about that?
Thanks in advance for any hints, your help is greatly appreciated.
Ralph[/url]
Chart Antialiasing question
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The anti-aliasing is "all-or-nothing" as far as I know. A number of people have requested the ability to turn off antialiasing just for text, so I will investigate that at some point.
The demo image you linked to is generated on Linux, so maybe that is why the vertical and horizontal lines aren't antialiased.
I know there is a RenderingHints.KEY_TEXT_ANTIALIASING hint - I haven't tried it yet, so I don't know which platforms support it.
The demo image you linked to is generated on Linux, so maybe that is why the vertical and horizontal lines aren't antialiased.
I know there is a RenderingHints.KEY_TEXT_ANTIALIASING hint - I haven't tried it yet, so I don't know which platforms support it.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 4
- Joined: Wed Mar 10, 2004 3:37 pm
David,
thanks for your answer. The following code snippet works on Mac OS X, so I am definitely able to influence the antialiasing behaviour:
This turns antialiasing off for everything but the fonts. I use that whenever I create a bar chart. However, when I create something like the Pareto chart from your site or a price-volume chart, I would really like to turn antialiasing on. My problem is that the borders of chart bars exhibit some really strange blurring if I turn on full antialiasing which looks very strange.
However, I guess if you did not encounter this problem on Linux, this must be a rendering bug in Apple's AWT implementation. Apple's JDK 1.4.1 and 1.4.2 seem to have this problem. I will try to test my code on another platform - if this is not a known issue with JFreeChart, it has to be some kind of platform-specific issue. I will consider submitting a bug report to Apple. [/code]
thanks for your answer. The following code snippet works on Mac OS X, so I am definitely able to influence the antialiasing behaviour:
Code: Select all
chart.setRenderingHints(new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
However, I guess if you did not encounter this problem on Linux, this must be a rendering bug in Apple's AWT implementation. Apple's JDK 1.4.1 and 1.4.2 seem to have this problem. I will try to test my code on another platform - if this is not a known issue with JFreeChart, it has to be some kind of platform-specific issue. I will consider submitting a bug report to Apple. [/code]
Re: Chart Antialiasing question
Hi, "on my machine" this was not enough. This
brought the desired result: smooth lines!
Code: Select all
chart.setRenderingHints(
new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR));