Compile problem

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

Compile problem

Post by Ben » Sun Feb 16, 2003 9:07 pm

1).
I try to Compile VerticalXYBarChartDemo.java under
demo directory, and I got the error message like

VerticalXYBarChartDemo.java:79: cannot resolve symbol
symbol : variable DemoDatasetFactory
location: class
com.jrefinery.chart.demo.VerticalXYBarChartDemo
TimeSeriesCollection data =
DemoDatasetFactory.createTimeSeriesCollection1();

But I have followed installation instructions and put
following jar files into my classpath,


D:\JFreeChart\jfreechart-0.9.5\jfreechart-0.9.5.jar;

D:\JFreeChart\jfreechart-0.9.5\jfreechart-0.9.5-demo.jar;

D:\JFreeChart\jfreechart-0.9.5\lib\jcommon-0.7.2.jar;

D:\JFreeChart\jfreechart-0.9.5\lib\gnujaxp.

why I get this message?


2).
Also, The followings are the copy from website:

String[] seriesNames = new String[] {"2001", "2002"};
String[] categoryNames = new String[] {"First Quater",
"Second Quater"};
Number[][] categoryData = new Integer[][] {{new Integer
(20),
new Integer(35)},
{new Integer(40),
new Integer(60)}
};
CategoryDataset categoryDataset = new
DefaultCategoryDataset
(seriesNames,
categoryNames,
categoryData);

But it seems that DefaultCategoryDataset does not
have this constructor. Am I using the wrong library?

David Gilbert

Re: Compile problem

Post by David Gilbert » Mon Feb 17, 2003 7:29 am

The jfreechart-0.9.5-demo.jar file contains the precompiled demo classes. If you want to recompile the demos from the source code, you probably shouldn't include this jar file on the classpath.

The DefaultCategoryDataset class has changed significantly in the 0.9.5 release. The sample code you have taken from the forum relates to an older version of JFreeChart.

Regards,

Dave Gilbert

Ben

Re: Compile problem

Post by Ben » Mon Feb 17, 2003 3:56 pm

I took out jfreechart-0.9.5-demo.jar from my classpath, but I still got the same error message when I tried to compile the same file VerticalXYBarChartDemo.java under demo directory :

VerticalXYBarChartDemo.java:79: cannot resolve symbol
symbol : variable DemoDatasetFactory
location: class
com.jrefinery.chart.demo.VerticalXYBarChartDemo
TimeSeriesCollection data =
DemoDatasetFactory.createTimeSeriesCollection1();



Any idea?

David Gilbert

Re: Compile problem

Post by David Gilbert » Mon Feb 17, 2003 4:31 pm

Can you supply the 'javac' command line you used? You will need to have a -sourcepath entry so that the compiler can find the DemoDatasetFactory class (which is in the same package as the VerticalXYBarChartDemo class).

Regards,

Dave Gilbert

Ben

Re: Compile problem

Post by Ben » Mon Feb 17, 2003 7:56 pm

I used " javac VerticalXYBarChartDemo.java " in command line. If this is not correct, what is the right command ?

Thanks,

Ben

David Gilbert

Re: Compile problem

Post by David Gilbert » Tue Feb 18, 2003 6:40 am

See if this helps:

http://forum.java.sun.com/thread.jsp?fo ... &trange=15

Regards,

Dave Gilbert

Locked