Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6575217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:21:36+00:00 2026-05-25T15:21:36+00:00

I get user list from database in jsp. In each user I have a

  • 0

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.

How can I get counts for each user in js?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:21:36+00:00Added an answer on May 25, 2026 at 3:21 pm

    Any js or jquery chart library suggestion

    I will suggest to use JqPlot for drawing chart. They are simple and good looking charts.

    How can I get counts for each user in js?

    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

    $(function(){
        plot = $.jqplot("piePlot", [[ // --- loop over your user list using jstl and get data value pairs
                      <c:forEach items='${ userList }' var='user'>
                         ['${user.userName}',parseInt('${user.userCount}')],
                      </c:forEach>
                   ]], { 
                        gridPadding: {top:0, bottom:38, left:0, right:0},
                        seriesDefaults:{
                              renderer:$.jqplot.PieRenderer, trendline:{show:true}, 
                              rendererOptions: { padding: 8, showDataLabels: true}},
                              legend:{
                                      show:true, 
                                      placement: 'inside', 
                                      rendererOptions: {
                                              numberRows: 1
                                      }, 
                              location:'s',
                              marginTop: '15px'
                       });
               });
    

    Assuming count variable name is userCount and name of user is stored in userName. The list you get is named as userList.

    HTML

    <!-- div where chart will be shown -->
    <div id="piePlot" style="margin-top:20px; margin-left:20px; width:200px; height:200px;">
    </div>
    

    Files needed to be included in page

    <link rel="stylesheet" type="text/css" href="js/jqPlot/jquery.jqplot.css" />
    <script type="text/javascript" src="js/jqPlot/jquery.jqplot.js"></script>
    <script type="text/javascript" src="js/jqPlot/plugins/jqplot.pieRenderer.min.js"></script>
    <!--[if lt IE 9]><script type="text/javascript" src="js/jqPlot/excanvas.js"></script><![endif]-->  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using JPA, I have a list of entries from my database : User(id, firstname,
how do i get a list of user that have completed or not completed
I populate web form with dynamic list of exams from database. I want user
I would like to get the list of users from the database, but I
I have a template that displays a list of objects from the database. {%
I have a list of user ids and want to get a few random
I can't get clean results from database, module PagesHelper def list wishes = WishList.select(content).where(user_id
I am displaying list of cities from the database ,each as a link.I want
I have a page called list.php which retrieves from database and shows all the
I'm trying to get a list of user's friends using fb connect for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.