I am using JFreeChart to have 2 datasets on the same graph. I am trying to do a comparison between how similar the points are on the graph and therefore I need access to the 2 datasets I put into the chart previously, but for some reason I can't seem to extract this information.
Here is how the data is input:
private static IntervalXYDataset createDataset()
{
DefaultXYDataset completeDataset = new DefaultXYDataset();
//populate with simulated data
double[][] sim = new double[2][simData.size()];
for(int i = 0; i < simData.size(); i++){
sim[0][i] = simData.get(i).getOne();
sim[1][i] = simData.get(i).getTwo();
}
//populated with known experimental data
double[][] exp = new double[2][expData.size()];
for(int i = 0; i < expData.size(); i++){
exp[0][i] = expData.get(i).getOne();
exp[1][i] = expData.get(i).getTwo();
}
completeDataset.addSeries("Simulated", sim);
completeDataset.addSeries("Experimental", exp);
XYBarDataset dataset = new XYBarDataset(completeDataset, .1);
return dataset;
}
The data is stored as a Pair initially, but this I know the data is input as the graph shows it correctly. How can I return the two series in this dataset?