How to disable scaling in JFreeChart?
- by Alex Arnon
Hi All,
We're using JFreeChart to build an engine to display graphs. This is a web service that runs on Tomcat + Java 1.5.0, and renders charts to PNGs and JPEGs (using ChartUtilities.writeChartAs{PNG,JPEG}() ).
We've run into a problem where JFreeChart seems to scale everything inside the Plot area, but only by a few pixels. The result is that the graph looks inconsistent, e.g.:
Minor ticks are sometimes stretched horizontally, so that they seem to be two pixels wide instead of one.
We use a small image in the top-right of the plot area as a watermark. This is stretched by one pixel horizontally and vertically somewhere near (but not exactly) its middle.
Background grid lines seem to appear on sub-pixel boundaries. I have not found a way to create an accurately dotted grid line.
We have tried both 1.0.9 and 1.0.13, with exactly the same results (except for the minor ticks, which were not available in the older version). Also, rendering the image to a Frame instead of JPEG/PNG produced an identical result.
Help is greatly appreciated, in advance :)