Hello,
I am using JFreeChart with JavaFX.
For the needs of my application I have to redraw the whole chart several times. At the first time, all chart functions (zooming, panning, etc.) perform pretty well. However, after several times of redrawing, these functionalities become very sluggish. Keep in mind that every time I redraw the chart, I create everything from scratch (ChartViewer, Chart, etc.), so I cannot find a good reason why this gradual slow down is happening.
My second problem is quite strange. When I try to use dashed lines in my TimeSeries chart, they appear as solid lines, or to be more precise, they appear as two lines, one dashed and one solid on top of the dashed one! When I save the plot as jpeg for example, dashed lines appear correctly! I guess there must be a problem with the ChartViewer (but I can't detect where!) since outside JavaFX, dashed lines work properly using the exact same code.
I have also used setDrawSeriesLineAsPath() with both TRUE and FALSE arguments without any change.
I would appreciate a lot any help or ideas on these two issues.
Dashed lines don't appear when using ChartViewer
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
Dashed lines don't appear when using ChartViewer
Last edited by SystemsEngineer on Thu Mar 16, 2017 10:36 am, edited 1 time in total.
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
Re: Slow chart functionalities and dashed lines don't appear
Thanks a lot for your reply!
I managed to solve my performance issue.
As far as the dashed lines problem, I wrote that as saved jpeg image, the dashed lines of my JFreeChart appear as they should. The problem is when the chart is drawn and appeared within a ChartViewer in my application (I use JavaFX). In this case, the dashed lines are covered by solid ones in a strange way. I guess it is a ChartViewer bug since outside JavaFX, JFreeChart shows dashed lines properly.
Any other possible fix ideas are welcome
I managed to solve my performance issue.
As far as the dashed lines problem, I wrote that as saved jpeg image, the dashed lines of my JFreeChart appear as they should. The problem is when the chart is drawn and appeared within a ChartViewer in my application (I use JavaFX). In this case, the dashed lines are covered by solid ones in a strange way. I guess it is a ChartViewer bug since outside JavaFX, JFreeChart shows dashed lines properly.
Any other possible fix ideas are welcome
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Dashed lines don't appear when using ChartViewer
Are you using the JFreeChart 1.0.19 release version, or the latest code from GitHub?
I will try to reproduce the problem, but if you have a small self contained demo program that you can post that will speed things up.
I will try to reproduce the problem, but if you have a small self contained demo program that you can post that will speed things up.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Dashed lines don't appear when using ChartViewer
Also, looking in the FXGraphics2D code, it looks like support for dashed lines was added in version 1.2.1. You should have that, but it is worth checking. Look in the source code for the setStroke() method and see if it has code for dashed lines in there.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
Re: Dashed lines don't appear when using ChartViewer
Thanks for the quick response!
You are right I was using the FXGraphics2D.java from release 1.0.19 (didn't know about the updates...). After updating it with the new code it works fine!
You are right I was using the FXGraphics2D.java from release 1.0.19 (didn't know about the updates...). After updating it with the new code it works fine!