java - JFreeChart implementation error -
import java.io.*; import org.jfree.data.category.defaultcategorydataset; import org.jfree.chart.chartfactory; import org.jfree.chart.plot.plotorientation; import org.jfree.chart.jfreechart; import org.jfree.chart.chartutilities; public class xyline { public static void main(string[] args){ try { /* step - 1: define data line chart */ defaultcategorydataset line_chart_dataset = new defaultcategorydataset(); line_chart_dataset.addvalue(15, "schools", "1970"); line_chart_dataset.addvalue(30, "schools", "1980"); line_chart_dataset.addvalue(60, "schools", "1990"); line_chart_dataset.addvalue(120, "schools", "2000"); line_chart_dataset.addvalue(240, "schools", "2010"); /* step -2:define jfreechart object create line chart */ jfreechart linechartobject=chartfactory.createlinechart("schools vs years","year","schools count",line_chart_dataset,plotorientation.vertical,true,true,false); /* step -3 : write line chart file */ int width=640; /* width of image */ int height=480; /* height of image */ file linechart=new file("line_chart_example.png"); chartutilities.savechartaspng(linechart,linechartobject,width,height); } catch (exception i) { system.out.println(i); } } }
i creating line chart points on it. line causing problems follows... jfreechart linechartobject=chartfactory.createlinechart("schools vs years","year","schools count",line_chart_dataset,plotorientation.vertical,true,true,false);
the error is: type org.jfree.util.publiccloneable cannot resolved. indirectly referenced required .class files
i have tried adding in jar file(jfreechart-1.0.14.jar) still not work. appreciated.
you need jcommon-1.0.14.jar
well. see downloading jfreechart more.
Comments
Post a Comment