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:


E-mail from Ned:

The DASHED and DOTTED options in our implementation are not working.

e.g., launch:


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:

it looks like we are using the outdated:


whereas they now recommend using:


The latter has a method setDrawSeriesLineAsPath(boolean flag) that I think may solve our problem.

Change History (1)

comment:1 Changed 10 years ago by Kevin Milner

Resolution: fixed
Status: newclosed

fixed in [10227] by switching to XYLineAndShapeRenderer and setting setDrawSeriesLineAsPath to false. Dotted/dashed now works beautifully with log plots as well.

Note: See TracTickets for help on using tickets.