How do I mix CandleStick and Line in a single chart?

Discussion about JFreeChart related to stockmarket charts.
Locked
leafy
Posts: 1
Joined: Thu Dec 04, 2003 5:04 am

How do I mix CandleStick and Line in a single chart?

Post by leafy » Thu Dec 04, 2003 5:06 am

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?)

tanigon

Re: How do I mix CandleStick and Line in a single chart?

Post by tanigon » Sun Feb 29, 2004 3:47 pm

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?)
My codes:

// 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.

Locked