Hi everybody,
I am looking for a way to perform 2 or more queries and combine the query results into a single graph. The statements return X, Y datasets.
JDBCXYDataset dataSet1 = new JDBCXYDataset(con1, query1);
JDBCXYDataset dataSet2 = new JDBCXYDataset(con2, query2);
This works perfectly, but, if possible, I would like to show dataSets1 and 2 as 2 separate lines in one XY graph. Unfortunatelyt I cannot find a way to combine both results into one graph that I could display using:
JFreeChart graph = ChartFactory.createXYLineChart(..., ..., ..., XYSeriesCollection)
Is there a way to cast dataSets1 and 2 to a XYSeriesCollection?
Thanks in advance for your tips!
Peter
Combining JDBCXYDatasets in one graph
-
- Posts: 2
- Joined: Mon May 11, 2020 9:30 pm
- antibot: No, of course not.
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: Combining JDBCXYDatasets in one graph
JDBCXYDataset can hold multiple series by including additional columns in the query.