JavaFX support

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
plusik
Posts: 28
Joined: Tue May 16, 2006 3:36 am
Location: Boston, MA, USA

JavaFX support

Post by plusik » Fri Jan 01, 2016 7:01 pm

Hi,

There has been no new release of JFreeChart since July 2014. Would it be possible to release an updated version including the JavaFX support classes, and deploy it in Maven Central? I think more and more people are working in JavaFX now, so it would be helpful.

Happy New Year!

Tomas

John Matthews
Posts: 479
Joined: Wed Sep 12, 2007 3:18 pm

Re: JavaFX support

Post by John Matthews » Sat Jan 02, 2016 12:12 pm

Would this imply the need for a separate Maven artifact For JavaFX?

For reference, I used Java 1.8.0_66 and ant 1.9.2 on Mac OS X 10.11 to build jfreechart-1.0.19-fx.jar:

Code: Select all

cd ant ; ant -f build-fx.xml all
The following error appears to be due to a change in the API between JavaFX 2.2: javafx.scene.control.Control and JavaFX 8: javafx.scene.control.Control.

Code: Select all

compile:
    ...
    [javac] source/org/jfree/chart/fx/ChartViewer.java:122: error: getUserAgentStylesheet() in ChartViewer cannot override getUserAgentStylesheet() in Region
    [javac]     protected String getUserAgentStylesheet() {
    [javac]                      ^
    [javac]   attempting to assign weaker access privileges; was public
    ...
   [javac] 1 error
Changing the signature to public seemed to produce a working JAR, for example:

Code: Select all

java -cp .:lib/* org.jfree.chart.fx.demo.BarChartFXDemo1
java -cp .:lib/* org.jfree.chart.fx.demo.PieChartFXDemo1
java -cp .:lib/* org.jfree.chart.fx.demo.TimeSeriesChartFXDemo1
Profiling with jvisualvm produced none of the CPU and memory problems mentioned in these related threads.

plusik
Posts: 28
Joined: Tue May 16, 2006 3:36 am
Location: Boston, MA, USA

Re: JavaFX support

Post by plusik » Wed Jan 06, 2016 7:46 pm

Yes, we can compile the javafx-enabled jar using ant, but it would be nice to have it in Maven Central so mavenized projects can directly add it as a dependency.

David, *please*.

david.gilbert
JFreeChart Project Leader
Posts: 11699
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: JavaFX support

Post by david.gilbert » Tue Jan 12, 2016 5:49 pm

It's noted. I'm working on doing new releases of FXGraphics2D, Orson Charts and JFreeChart. It's slow because I don't have much spare time but I will create the Maven artefact for a JavaFX enabled version of JFreeChart when the release (1.0.20) is done.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

DJViking
Posts: 10
Joined: Mon May 27, 2013 9:22 am
antibot: No, of course not.

Re: JavaFX support

Post by DJViking » Wed Feb 08, 2017 3:15 pm

What is the status of version 1.0.20 with a JavaFX module?

We would like to start using JFreeChart with JavaFX as we are moving away from Swing.

In the meantime. How can I start using JFreeChart with JavaFX until 1.0.20 is ready?
I have been trying to compile a package myself from the source, but that didn't go so well.
Tried first to run maven build, that did not work.
Tried to execute the ant builds. I was able to build the standard build.xml, but build-fx.xml failed with same error as John Matthews got.

Edit: I got the source from GitHub and was able to build with maven using maven/pom-javafx.xml

Edit: Seems like JFreeChart and PolarPlot still uses some Swing/AWT code. Are there any plans for full JavaFX support on those?

DJViking
Posts: 10
Joined: Mon May 27, 2013 9:22 am
antibot: No, of course not.

Re: JavaFX support

Post by DJViking » Fri Feb 10, 2017 10:45 am

Is it possible to style the JFreeChart with CSS? I have a PolarPlot which I style programaticaly and would like to use CSS to get a consistent look.
PolarPlot .setAngleGridlinePaint()
PolarPlot .setRadiusGridlinePaint()
JFreeChart .setBackgroundPaint()
PolarPlot .setBackgroundPaint()
PolarPlot .setBackgroundImage()
PolarItemRenderer .setSeriesPaint()

Since both JFreeChart and PolarPlot are using AWT I think perhaps it is not possible to style with CSS. Or is it?

Edit: The ChartViewer does seem to support CSS, according to its Javadoc, but what are the style properties available for it?

Would be great if JFreeChart with ChartViewer and ChartCanvas could support the CSS style properties defined in JavaFX Charts
https://docs.oracle.com/javase/8/javafx ... tml#charts

Isn't support for CSS easy to implement in ChartViewer and ChartCanvas? Just add style classes for plots like PolarPlot.

david.gilbert
JFreeChart Project Leader
Posts: 11699
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: JavaFX support

Post by david.gilbert » Fri Feb 10, 2017 4:59 pm

The JavaFX support will remain as implemented already, via the bridge class FXGraphics2D...which means that the rendering will be to a JavaFX Canvas node. The next release will just fix some issues and include the JavaFX support out-of-the-box without requiring the library to be built from the sources.

There isn't any CSS support yet. I will spend some time looking at StylableProperties to provide some CSS styling capability....this was suggested to me by Gerrit Grunwald at a JavaFX meeting in Zurich in December, but I haven't had a chance to try it yet.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

DJViking
Posts: 10
Joined: Mon May 27, 2013 9:22 am
antibot: No, of course not.

Re: JavaFX support

Post by DJViking » Sun Feb 12, 2017 6:56 pm

david.gilbert wrote:There isn't any CSS support yet. I will spend some time looking at StylableProperties to provide some CSS styling capability....this was suggested to me by Gerrit Grunwald at a JavaFX meeting in Zurich in December, but I haven't had a chance to try it yet.
Great. It would help us a lot with CSS support. Specially now that we are moving away from Swing.

Post Reply