How do I mix CandleStick and Line in a single chart?
How do I mix CandleStick and Line in a single chart?
As the question states, I currently derive moving averages and use CombinedDataSet. Is there a way to use different renderer for different series and display them on the same chart (or plot?)
Re: How do I mix CandleStick and Line in a single chart?
My codes:leafy wrote:As the question states, I currently derive moving averages and use CombinedDataSet. Is there a way to use different renderer for different series and display them on the same chart (or plot?)
// add 10dMA 20dMA into candlestick plot
StandardXYItemRenderer mar = new StandardXYItemRenderer();
XYSeriesCollection data2 = new XYSeriesCollection(xy_ma);
data2.addSeries(xy_ma2);
candlePlot.setSecondaryDataset(0, data2);
candlePlot.setSecondaryRenderer(0, mar);
xy_ma contains 10dMA XYSeries, xy_ma2 as well.
I guess a point you want is setSecondary*() of XYPlot.