I am using JFreeChart inside JavaFX application. Currently I am using SwingNode to embed chart inside JavaFX scene but there are some unpleasant lags during node re-size so I am trying to migrate to ChartViewer. It works fine for static plots, but it produces random crashes when I am trying to make a lot of dynamic changes simultaneously (for example, I have about 100 line plots in one chart window and I am changing their parameters).
Sometimes it just throws exceptions and stops whatever it is doing, but sometimes it just crashes the whole JavaFX framework. It produces a lot of different errors at random, but the most frequent ones are:
Code: Select all
java.lang.InternalError: Unrecognized PGCanvas token: 66
Code: Select all
java.lang.InternalError: Unrecognized PGCanvas token: 67
and
Code: Select all
java.nio.BufferOverflowException
at com.sun.javafx.sg.prism.GrowableDataBuffer.ensureReadCapacity(GrowableDataBuffer.java:317)
I believe such problems are usually connected with multithreading problems, but all my calls to JFreeChart API are synchronized and wrapped in Platform.runLater(). The problem exists both for latest JfreeChart (1.5.0- SNAPSHOT) and fse editions.