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?
Compile problem
Re: Compile problem
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
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
Re: Compile problem
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?
VerticalXYBarChartDemo.java:79: cannot resolve symbol
symbol : variable DemoDatasetFactory
location: class
com.jrefinery.chart.demo.VerticalXYBarChartDemo
TimeSeriesCollection data =
DemoDatasetFactory.createTimeSeriesCollection1();
Any idea?
Re: Compile problem
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
Regards,
Dave Gilbert
Re: Compile problem
I used " javac VerticalXYBarChartDemo.java " in command line. If this is not correct, what is the right command ?
Thanks,
Ben
Thanks,
Ben