I have succesfully got it plotting candlesticks in real time I am using a OHLCDataset[]. I want to plot some trendlines on the same graph. I can get the open/close data etc out of the list of OHLCDataItem's and create a new data set of them - Date/Time against Open/close etc, however Im not sure how to plot that data on the same graph.
Here is the current dataloading code:
Code: Select all
List<OHLCDataItem> results = thread.getResults();
OHLCDataItem[] dataItems = results
.toArray(new OHLCDataItem[results.size()]);
generalDataSet = new DefaultOHLCDataset("graph",
dataItems);
mainPlot.setDataset(generalDataSet);
So I create a new List of (Im not sure what type - I want Date against 1 other piece of data?????) and add the date and open/close to it from results.
Then Im doing:
Code: Select all
mainPlot = new XYPlot(generalDataSet, domainAxis, rangeAxis,
candleStickRenderer);
candleStickRenderer.setSeriesPaint(0, Color.BLACK);
candleStickRenderer.setDrawVolume(false);
Code: Select all
mainPlot.setDataset(1, [**OTHER DATA SET**]);
mainPlot.setRenderer(1, LineRenderer);
Thanks