Multiple OHLC datasets in one image
问题 How can I chart multiple datasets in one image using JFreeChart ? Essentially I want to chart a stock's price and it's moving average line in one image. I've tried getting the XYPlot and adding the second dataset, but it does not work. DefaultOHLCDataset dataset = new DefaultOHLCDataset(symbol, items); DefaultOHLCDataset dataset2 = new DefaultOHLCDataset(symbol, evs); JFreeChart chart2 = ChartFactory.createHighLowChart( symbol, "minutes", "prices", dataset, true); chart2.getXYPlot()