Charts as cells of a table

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Vinod

Charts as cells of a table

Post by Vinod » Wed May 08, 2002 7:47 pm

I'm trying to combine JFreeChart with a JTable - I have a table which has only 1 row and several columns. The first column will contain a vertical axis and other columns will contain 2D plots (typically line graphs).

I've managed to get a JFreeChart to display inside the JTable - define a new CellRenderer which creates a JFreeChartPanel and uses that as the component.

But the first column contains only an axis. Is there a way to get only an axis using JFreeChart? I've just started using JFreeChart, so haven't found anything that would help so far.
Thanks!

Vinod

David Gilbert

Re: Charts as cells of a table

Post by David Gilbert » Thu May 09, 2002 4:33 pm

Hi Vinod,

You can't display an axis on it's own...but all axes have a draw(...) method, so you might be able to hack together a custom AxisPanel. Does your JTable contain other data besides the charts? Or are you just using the table for layout? The combined charts might work for you (they are being simplified somewhat for the next release)...

Regards,

DG.

Vinod

Re: Charts as cells of a table

Post by Vinod » Fri May 10, 2002 9:47 pm

I was thinking about using the individual draw methods in the axis classes to try to get what I'm looking for. I wanted to make sure there isn't a simpler way to do it.

I'm using JTable mainly for convenience reasons. As of now all columns will be only charts, but I'll have to extend it to show images as well. And user should be able to add and delete columns (which essentially show different values from a database) dynamically.
Thanks for your suggestions! If I get something like "AxisPanel" working I'll be sure to send it to you.

Vinod

Locked