Question

I'm trying to create a new JFreeChart, i have both JCommon (1.0.22) and JFreeChart (1.0.17-demo) in my Build Path for the project;

However, when i try to create code, in this case;

        CategoryDataset dataset = createDataset();
    JFreeChart chart = createChart(dataset);
    ChartPanel chartPanel = new ChartPanel(chart, false);
    chartPanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartPanel);

I get an Error at "JFreeChart" with no Import option available.

I'm using the guide here:

http://www.java2s.com/Code/Java/Chart/JFreeChartBarChartDemo1.htm

To try and create a Chart (Just to check imports right now) But i can import org.jfree.(anything) like org.jfree.ui

BUT i cannot import org.jfree.chart

As it says it doesn't exist in my libraries. Any ideas?

Was it helpful?

Solution

jfreechart-1.0.17-demo.jar is the JAR file that contains demo examples, not the actual library.

Look in the lib folder and use jfreechart-1.0.17.jar.

OTHER TIPS

two library is needed:

  • jcommon-1.0.23.jar
  • jfreechart-1.0.19.jar

(the demo jar is not library. it's a great sample of outputs you can have.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top