Set JFreeChart data from database

  1. Create Database and finish the configuration.


Consider this Example: link 

dataset.addValue(1.0, series1, category1);

There you set value for the chart.



   while(resultset.next()){
      String test = resultset.toString(1);
      dataset.addValue(test, "series1", category1);
   }




  1. Using database get the result set and devide that result set using while loop like this:
    

if there any problem regarding that, add ur comment here





Comments

Anonymous said…
while(resultset.next()){
String test = resultset.toString(1);
dataset.addValue(test, "series1", category1);
}

Mate, "test" must be an integer not String. Check it

Popular posts from this blog

XSLT - Modify Date and DateTime value

Integrate With Mutual Certificate Authentication based Service

Yield Price Sri Lanka - Android Application