Adding a chart to a panel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dmacleod
Posts: 8
Joined: Fri Jun 29, 2007 4:48 pm
Location: Florida, USA

Adding a chart to a panel

Post by dmacleod » Wed Jul 11, 2007 5:59 pm

I created a Bar Chart and would like to add it to a JTabbedPane. However, when I run the line: pane.addTab(tabTitle, chart); I get an error: The method addTab(String, Component) in the type JTabbedPane is not applicable for the
arguments (String, JFreeChart)

How can I add a chart to a panel? I can't seem to find the answer in the Developer Guide.

thanks

RichardWest
Posts: 844
Joined: Fri Oct 13, 2006 9:29 pm
Location: Sunnyvale, CA

Re: Adding a chart to a panel

Post by RichardWest » Wed Jul 11, 2007 6:38 pm

dmacleod wrote:How can I add a chart to a panel? I can't seem to find the answer in the Developer Guide.
Add the JFreeChart to a ChartPanel and add the ChartPanel to the JTabbedPane.
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA

Locked