Opened 10 years ago
Closed 10 years ago
#431 closed defect (fixed)
Improve Dashed and Dotted lines in JFreeChart plots
Reported by: | Kevin Milner | Owned by: | Kevin Milner |
---|---|---|---|
Priority: | major | Milestone: | OpenSHA 1.3 |
Component: | commons | Version: | |
Keywords: | Cc: |
Description
E-mail from Ned:
The DASHED and DOTTED options in our implementation are not working.
e.g., launch:
org.opensha.sha.earthquake.calc.recurInterval.gui.ProbabilityDistGUI.main(String[])
click "Plot-Dist", and change to dashed under "Plot Prefs".
I played around with settings and nothing looks good (e.g., curves have uneven dashes and spacing, even appearing solid on some parts).
I think the problem is that JfreeChart? is plotting each line segment separately (e.g., selecting a line in Illustrator will only get you the local line segment).
Reading this post:
http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=25214
it looks like we are using the outdated:
StandardXYItemRenderer
whereas they now recommend using:
XYLineAndShapeRenderer
The latter has a method setDrawSeriesLineAsPath(boolean flag) that I think may solve our problem.
fixed in [10227] by switching to XYLineAndShapeRenderer and setting setDrawSeriesLineAsPath to false. Dotted/dashed now works beautifully with log plots as well.