Is is posibble adding 2 dataset? (or some other operations)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
onderulker
Posts: 13
Joined: Mon May 22, 2006 3:01 pm

Is is posibble adding 2 dataset? (or some other operations)

Post by onderulker » Wed Dec 27, 2006 4:43 pm

Hi all,

I need to add 2 datasets.

DS1 :
DATE | S1
1-1-2006 | 48
1-2-2006 | 32
1-3-2006 | 3
1-4-2006 | 45
1-5-2006 | 47

DS2:
DATE | S2
1-1-2006 | 45
1-2-2006 | 64
1-3-2006 | 67
1-4-2006 | 13
1-5-2006 | 54

DS1 + DS2 = TDS
TDS:
DATE | S1 | S2
1-1-2006 | 48 | 45
1-2-2006 | 32 | 64
1-3-2006 | 3 | 67
1-4-2006 | 45 | 13
1-5-2006 | 47 | 54

Reason is;

I have 2 dataset (like DS1 and DS2) and get these from DB with JDBCCategoryDataset(..) function. Their date column and date column datas are same.

I want to draw a bar chart with these dataset. When I try to create a chart; I put DS1 into createBarChart( ... ) function and I put second one into chart with plot.setDataset(...) function.

At the end I got a chart like that :

http://docs.google.com/View?docid=ddw99tpn_63gpbdz8

But I need to this like a BarChartDemo1 or BarChartDemo8.

If I could prepare a dataset like TDS (above) I think I would solve problem...

Is there any solution, way or opinion?

Regards;

Onder.

Locked