Open JDBC-0 opened 2 years ago
I frequently migrate charts from v1.0.19 to v1.5.x with the default fonts, but I haven't encountered this. Do you have a short example and font that reproduces this.
Unfortunately, these are customer fonds that are only their property. But perhaps you could try misc fonts, set the chart title aligned to the right and see if the very same text is displaced on each other fond.
I understand about proprietary fonts: if you can't reproduce the problem without their font, they may need to contact the font vendor. If you can, I'll try your code on my platform.
It is not about these fonts as they work flawlessly with JFreeChart 1.0.17 .... just by switching to 1.5.3, some of such chart titles suddenly moved to the right or to the left. We noticed this as most of our chart titles are right aligned and now many of them have displaced chart titles.
We now must revert all the code changes back to JFreeChart 1.0.17 as this is unacceptable.
I went back and created 2 versions of our app: one with the JfreeChart 1.0.17 API and one with JFreeChart 1.5.3 API. I compared both generated SVGs and noticed differences in the numbers! We still use the Apache FOP internal Batik API to save the chart as SVG - not a single character is changed in the source code - only JFreeCjart exchanged.
I noticed the with JFreechart 1.5.3, several numbers changed. Some numbers now miss the decimal places: (I had to remove the opening/closing XML charatcers for the code show here!)
` old: text x="138.0029" xml:space="preserve" y="7.4395" style="clip-path:url(#clipPath1); stroke:none;"
new: text x="147" xml:space="preserve" y="7.4395" style="clip-path:url(#clipPath1); stroke:none;"
old: rect x="112.2358" y="163.8018" width="115.5283" style="clip-path:url(#clipPath1); fill:white; stroke:none;" height="15.1982"
new : rect x="112" y="163" width="116" style="clip-path:url(#clipPath1); fill:white; stroke:none;" height="16" `
Some differ by 1 maybe some changed rounding?):
` old : rect x="38" y="15" width="290" style="clip-path:url(#clipPath1); stroke:none;" height="127"
new : rect x="37" y="15" width="291" style="clip-path:url(#clipPath1); stroke:none;" height="126" `
I even noticed a new attribute (here: "stroke-width"):
` old: g style="fill:rgb(0,48,87); text-rendering:geometricPrecision; font-size:8px; shape-rendering:crispEdges; font-family:'Corporate S Light'; stroke:rgb(0,48,87);"
new : g style="font-size:8px; fill:rgb(0,48,87); text-rendering:geometricPrecision; font-family:'Corporate S Light'; shape-rendering:crispEdges; stroke:rgb(0,48,87); stroke-width:0.5;" `
Again: I changed back to JFreeChart 1.0.17 and the new SVG is identical to the version before JFreeChart 1.5.3.
So, as all other things are equal, there had to be changes in JFreeChart that had side effects to the placement ... when I look at the numbers, not only to the chart title, but also the chart itself. (The title is just obvious as you cleary see the displacement of the text leading to several characters cut off - within the boundary box of the FOP report that displays the chart SVG)
Well, I tested JFreeSVG and the problem does not show up with it. But we can't switch fast to JFreeSVG as this involves a lot of testing and might introduce other problems.
However, I showed that this problem was introduced by only JFreeChart (from 1.0.17 to 1.5.3) with all other parts staying the same. It is suspicious that suddenly some values seem to be rounded (and not with earlier JFreeChart version) and especially some do not have a fraction anymore. I consider this a bug as this reduced precision.
I see that Apache FOP has also evolved in the interim. Can you indicate which version was working with JFreeChart 1.0.17? Does a later vision work with JFreeChart 1.5.3?
We also keep FOP up to date, so JFreeChart 1.0.17 worked with all the latest FOP versions - incl. the latest 2.7 we use. So, we we use FOP 2.7 and after switching to JFrereChat 1.5.3, the problem appeared.
Just stumbled over this thread. Sounds like a very annoying problem! A couple of suggestions from my side:
We upgraded from V 1.0.17 to V 1.5.3. For some Fonts, the chart titles moved to the left or right. As we have chart titles aligned to the right boorder, this led to cut of chart titles! This occurs dependend on the used font. Somehow, JFreeChart 1.5.x changed the generation of the chart titles so that they are misplaced compared to the previous V1.0.x version.