java - Read csv file to draw a pie chart in JfreeChart -
i'm trying read each csv file directory , calculations, using ratio each category draw pie chart using jfreechart. using piechartdemo1.java sample, should specify filereader , pass variables datasest? kept getting error message compiler. have demo coming in week, appreciated!
defaultpiedataset dataset = new defaultpiedataset(); //filereader... //int sum = counta + countb + countc; //double ratioa = counta / double(sum) * 100.0; //..... dataset.setvalue("category a", new double(ratioa)); dataset.setvalue("category b", new double(ratiob)); dataset.setvalue("category c", new double(ratioc)); //....
the class csv
can create categorydataset
suitable use categorytopiedataset
.
Comments
Post a Comment