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 8129757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:25:39+00:00 2026-06-06T08:25:39+00:00

Sorry for this based question. I am fresh to jqplot and would like to

  • 0

Sorry for this based question. I am fresh to jqplot and would like to use it to generate a bar graph based on data calculated from a function.

Now, I have a parameter which holds data. Also, I have simple codes to generate a bar plot. So, can anyone give me a hint on how to link these two pieces together?

Thanks!

Here is the code:

x_data=function(a,b,c,d) 
#this is the data generated from a function and it needs to be 
#sent to jqplot function, i.e., x_data=[165.33, 102.9, 89.04, 181.54, 114.92]. 
#In order to pass the parameter to jqplot, do I need to print it out in the HTML?


<script type='text/javascript'> 
$(document).ready(function(x_data){
        $.jqplot.config.enablePlugins = true;
        var s1=x_data; //I need to find a way to link s1 to x_data 

        $.jqplot('chart1', [s1], {
            seriesDefaults:{
                renderer:$.jqplot.BarRenderer,
                pointLabels: { show: true },
                rendererOptions: {
                barWidth: 3
                }
            }
        })   
    })
</script>
  • 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-06-06T08:25:41+00:00Added an answer on June 6, 2026 at 8:25 am

    You need to make sure that whatever you are entering as the 2nd parameter of the $.jqplot() method, in your case it is x_pre_irr, is in the form of, e.g.

    [[[1,2],[2,3],[3,6],[4,5]],[[1,2],[2,3],[3,6],[4,5]]].

    You could find more details in the examples here.

    EDIT
    You have few important errors there:

    1. With bar chart the CategoryAxisRenderer should be used:

          axes:{
              xaxis: {
                  renderer: $.jqplot.CategoryAxisRenderer
              }
          }
      
    2. To get stuff inside a HTML tag using jQuery you use text() (or html())
      method, not val() as it returns whatever a tag has in its value parameter.

    3. Then whatever you will get will be a String thus you must convert it to array of values, e.g. using $.parseJSON($('#x_pre_irr_val').text());.

    This is presented in this sample.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to remove the popup message 'Sorry this video cannot be played' from
me again. Sorry about this. Following on from my previous question (I think I
I'm sorry in advance if this question is really weird. I am sending data
Sorry this is not a very well defined question, I am thinking about an
Sorry this is a basic question, but all my research just barely missed answering
sorry this is such a simple question but I can't figure it out. How
Sorry if this question seems stupid, but it's stumped me for a couple days,
Sorry if this is a stupid question, but is there an easy way to
Sorry if this question is a bit open ended, but I'm pretty new to
Sorry about this silly question. I'm trying to learn objc and I'm unable to

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.