Search code examples
javajfreechart

jfreechart dataset z-index (overlapping)


I have jfreechart with two datasets: OHLCSeries & TimeSeries Line.

I need the line chart to be on top (above the OHLC Series).

How is it possible to set overlapping of the dataset?

enter image description here

Short question: How to get the white line to the top (above OHLC series) ?

Complete source of demo on github.


Solution

  • This does the magic:

    chart.getXYPlot().setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

    And result: while line is on top.

    enter image description here