Page 1 of 1

How can i mix 2 graph (jfree 0.92.21)

Posted: Mon Jan 10, 2005 8:06 am
by Guest
Hi, thanks for jfree chart
but i have some problems about how to mix to graph
i have OHLC Graph and want to add volume line (and ma line too)

which dataset that i should do (TimeSeries or XYSeries)

please give me an example code
thanks.

Posted: Thu Feb 17, 2005 9:13 am
by RCDran
Try this!

Code: Select all

plot_.setRenderer(0, rendererA);
plot_.setRenderer(1, rendererB);

plot_.setDataset(0, (XYDataset) datasetA);
plot_.setDataset(1, (XYDataset) datasetB);
additionally you can also do a map between dataset and renderer like below.

Code: Select all

plot_.mapDatasetToDomainAxis(0, 0);
plot_.mapDatasetToDomainAxis(1, 0);