9

Does anybody knows how to draw a vertical dashed line in Jfreechart at some given coordinates ?

Thanks

1 Answers1

22

Example 5 shows a series of dashed lines for a chart. Set your stroke thus:

plot.getRenderer().setSeriesStroke(
    0, 
    new BasicStroke(
        2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
        1.0f, new float[] {6.0f, 6.0f}, 0.0f
    )

and you'll need to set your dataset to simply reference the coordinates of your vertical line.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440