Bubble Charts in JFreeChart

S

stephen.l.long

I need to simply modify the current bubble chart in JFreeChart to use a
time axis instead of the data axis. Is anyone aware of how to do this?
I have been working on this problem for a while now and each way I
have tried causes conflicts with other parts of JFreeChart. I am
relatively new to this and any help at all would be greatly appreciated.
 
D

David Gilbert

I need to simply modify the current bubble chart in JFreeChart to use a
time axis instead of the data axis. Is anyone aware of how to do this?
I have been working on this problem for a while now and each way I
have tried causes conflicts with other parts of JFreeChart. I am
relatively new to this and any help at all would be greatly appreciated.

You can just replace the domain axis, something like this:

XYPlot plot = (XYPlot) chart.getPlot();
plot.setDomainAxis(new DateAxis("Date"));

Note that now the axis will interpret your x-values as "milliseconds
since 1-Jan-1970" (the way that java.util.Date does), so you will
probably need to change the values in your dataset accordingly.

Regards,

Dave Gilbert
JFreeChart Project Leader
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top