JFreeChart - change SeriesStroke of chart lines from solid to dashed in one line

前端 未结 3 1022
生来不讨喜
生来不讨喜 2021-01-12 05:36

The answer accepted here (JFreechart(Java) - How to draw lines that is partially dashed lines and partially solid lines?) helped me start down the path of changing my series

3条回答
  •  佛祖请我去吃肉
    2021-01-12 06:25

    I'm still having the same problem of the line not changing from solid to dashed, but being one or the other.

    The setDrawSeriesLineAsPath() method "controls whether or not each series is drawn as a single path." This precludes changing the Stroke dynamically, as getItemStroke() will be called only once per series.

    Addendum: An easy way to verify this is to invoke setDrawSeriesLineAsPath() in @GrahamA's example and break in drawFirstPassShape() in the debugger.

提交回复
热议问题