jfreechart icon indicating copy to clipboard operation
jfreechart copied to clipboard

`org.jfree.chart.ChartUtilities` renamed to `org.jfree.chart.ChartUtils` without deprecated paper-trail

Open ronreynolds2 opened this issue 7 years ago • 25 comments

more of a comment; tho also the javadocs don't mention this move (in fact Google has yet to hear of org.jfree.chart.ChartUtils; it was only by cracking open the 1.5.0 jar that we were able to find where ChartUtilities went).

ronreynolds2 avatar Nov 06 '17 22:11 ronreynolds2

Please correct me if I am wrong but I believe the same happened with org.jfree.chart.util.ParamChecks. It's named org.jfree.chart.util.Args now.

The change you mention can be found in this commit: 0763be8ec6b44c7fd782fd497aadcd455f0491f0

The change I mention can be found in this one: 22701c9ec4cd5bd88f8a7f17ae11c18099dd1ec7

mayuso avatar Nov 06 '17 22:11 mayuso

Also many getBase/setBase methods were renamed to getDefault/setDefault (e.g., XYLineAndShapeRenderer.setBaseLinesVisible() -> XYLineAndShapeRenderer.setDefaultLinesVisible(). I had to correct about 200 compilation errors in my project after upgrading JFreeChart from 1.0.19 to 1.5.0. That's life, I guess. But wasn't the https://github.com/jfree/jfreechart-fse project started for that purpose (updating the API)?

tomas-pluskal avatar Nov 06 '17 22:11 tomas-pluskal

Please list all the changes you spot, I'll add migration notes to the README. And I'll get the latest API docs uploaded and update the website.

jfree avatar Nov 06 '17 22:11 jfree

This is what noted when ported my application from jfreechart 1.10.19:

  • org.jfree.ui became org.jfree.chart.ui

And

  • (Stacked)BarRenderer3D
  • Axis3D
  • setToolTipGenerator()
  • org.jfree.ui.about

disapperead? These changes impact my exisitng functionality.

krheinwald avatar Nov 16 '17 12:11 krheinwald

org.jfree.ui.RefineryUtilities -> org.jfree.chart.ui.UIUtils

Petikoch avatar Nov 16 '17 15:11 Petikoch

import org.jfree.ui. ... -> import org.jfree.chart.ui. ...

Petikoch avatar Nov 16 '17 15:11 Petikoch

But most important: The 1.5.0 charts looks as good as the 1.0.19 charts -> everything is working fine after the manual code migration :-) Thank you @jfree for this library!

Petikoch avatar Nov 16 '17 15:11 Petikoch

@Petikoch - Did you use any of 3D Bar Charts, Custom Tooltips, Context Menus? It seems they went AWOL?

krheinwald avatar Nov 18 '17 06:11 krheinwald

@krheinwald I don’t know, I’m using only 2D stuff

Petikoch avatar Nov 18 '17 14:11 Petikoch

Thanks! Any experience with the other sstuff -Tooltips, Context Menus?

krheinwald avatar Nov 18 '17 15:11 krheinwald

On 16 Nov 2017, at 13:00, krheinwald [email protected] wrote:

This is what noted when ported my application from jfreechart 1.10.19:

org.jfree.ui became org.jfree.chart.ui

(Stacked)BarRenderer3D

Axis3D

The “faux” 3D plot code is removed, better options are provided by Orson Charts.

setToolTipGenerator()

Should be still there…getDefaultToolTipGenerator()?

org.jfree.ui.about

disapperead? These changes impact my exisitng functionality.

This stuff wasn’t really essential, but please copy the classes from JCommon if you need them.

I added some notes to the README for the 3D classes.

jfree avatar Nov 18 '17 18:11 jfree

I successfully migrated to JFreeChart 1.5, only lots of (painful but) trivial class name changes / fix imports.

One question: I just figured out the (default) legend has no more a visible border, is it wanted ? You can see it in jfreechart demos v1.0.19 but no more in v1.5

Will see if there are new legend properties...

bourgesl avatar Dec 20 '17 14:12 bourgesl

DatasetUtilities moved to DatasetUtils

twistedtwin avatar Jan 09 '18 02:01 twistedtwin

ShapeUtilities renamed to ShapeUtils TextUtilities renamed to TextUtils

isPointInRect moved from AbstractXYItemRenderer to ShapeUtils

twistedtwin avatar Jan 09 '18 02:01 twistedtwin

I had used custom calculateDomainMarkerTextAnchorPoint() in CombinedDomainXYPlot. I change method from RectangleAnchor.coordinates(Rectangle2D anchorRect. RectangleAnchor anchor) to anchor.getAnchorPoint(RectangleAnchor anchorRect).

Method RectangleAnchor.coordinates() disappeared.

pos9101 avatar Mar 22 '22 05:03 pos9101

I see that change here in the v1.5.3 branch. The changes may guide your revised approach.

trashgod avatar Mar 22 '22 18:03 trashgod

When migrating from JFreeChart 1.0.17 to 1.5.4, I changed :

setStroke(Stroke) -> setDefaultStroke(Stroke) setBaseShapesVisible(boolean) -> setDefaultShapesVisible(boolean)

And

rendererBlue.setDefaultStroke(new BasicStroke(3.0f));

became

 renderer.setDefaultStroke(new BasicStroke(3.0f));
 ((AbstractRenderer) renderer).setAutoPopulateSeriesStroke(false);

(See jfree.org/forum for the last change justification)

AlexyNau avatar Jan 16 '24 16:01 AlexyNau

See also Migration.

trashgod avatar Jan 16 '24 19:01 trashgod

Right clicking a chart and selecting "save as ... png" I got this error msg : "java.lang.NoClassDefFoundError: org/jfree/chart/ChartUtilities". (Jfreechart vers. 1.5.4, maven dependency)

ffedeli avatar Apr 23 '24 17:04 ffedeli

Right clicking a chart and selecting "save as ... png" I got this error msg : "java.lang.NoClassDefFoundError: org/jfree/chart/ChartUtilities". (Jfreechart vers. 1.5.4, maven dependency)

I can't reproduce this using jfreechart-1.5.4 from here, which uses org.jfree.chart.ChartUtils. Any chance you have an older version in the classpath?

trashgod avatar Apr 23 '24 23:04 trashgod

Probably this issue comes from this MAVEN dependency I used:

org.jfree jfreechart 1.5.4

In fact, replacing this dependency with your jfreechart-1.5.4.jar file directly in my java build path all runs OK.

Note: I compared with Windows FC command your jfreechart-1.5.4.jar file with my maven downloaded file and they seem identical, so I don't understand why the second solution works fine

Thank you for your support

ffedeli avatar Apr 24 '24 14:04 ffedeli

Sorry, this is MAVEN dependency link https://mvnrepository.com/artifact/org.jfree/jfreechart

ffedeli avatar Apr 24 '24 14:04 ffedeli

Yes, the files have identical checksums. Did any older version(s) turn up on the classpath? You might search for errant JARs in the directories found in the system property java.library.path or your IDE's project library.

trashgod avatar Apr 24 '24 18:04 trashgod

Found, it's my fault. My Java application is designed in the SWT framework, so I thought I should use both MAVEN dependencies for jfreechart-1.5.4.jar and jfreechart-swt-1.0.jar. It was a big mistake, only the latter is necessary!! In fact, jfreechart-swt-1.0.jar has embedded jfreechart-1.0.19.jar (and other jars...) as you can see in the attached file By doing so everything really works well!! Your last comment, trashgod, put me on the right track, thanks

ffedeli avatar Apr 25 '24 15:04 ffedeli

sorry, this is the file Screenshot 2024-04-25 170308

ffedeli avatar Apr 25 '24 15:04 ffedeli