I get user list from database in jsp. In each user I have a field named count. I have to show chart [pie and bar] for this count. I search on net found libraries for drawing chart in javascript but didn’t get success in implementing them as I don’t know how can I pass the values to the chart? Can any body recommend some good style to do this.
Note:- Any js or jquery chart library suggestion is welcome as far as they are free and commercially usable. Bar and pie charts are more preferable.
Edit:-
I know how to draw charts with predefined data. But here data is not predefined. My problem is how can I get counts in js. I’m getting list of users in jstl.
I will suggest to use JqPlot for drawing chart. They are simple and good looking charts.
You can easily use JSTL in javascript. What you need to do is just loop over your user list and add [username, usercount] pair in data of chart in javascript. A sample code can be …
Javascript
Assuming count variable name is
userCountand name of user is stored inuserName. The list you get is named asuserList.HTML
Files needed to be included in page