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

  • SEARCH
  • Home
  • 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 6959387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:15:57+00:00 2026-05-27T15:15:57+00:00

Situation: I have a function that dumps input data into an HTML block element,

  • 0

Situation:
I have a function that dumps input data into an HTML block element, eg:

function national(){
x=Number($('#nationalBudget').val());
a=x*2;
$('#one').text(a);}

Then it prints the input into any element with the id="one"

<span id="one"></span>

This is fine, but I would like to incorporate a jQuery Bargraph. The bargraph that I am using is fed by an array:

  coolnessGraph = new Array(
                   [100000,'ROI w/ Local Spending'],
                   [200000,'ROI w/o Local Spending']
$("#ROIchart").jqBarGraph({
            data: coolnessGraph, // array of data for your graph
            title: false, // title of your graph, accept HTML
            barSpace: 10, // this is default space between bars in pixels
            width: 400, // default width of your graph
            height: 200, //default height of your graph
            color: '#F8981D', // if you don't send colors for your data this will be default bars color
            colors: false, // array of colors that will be used for your bars and legends
            lbl: '', // if there is no label in your array
            sort: false, // sort your data before displaying graph, you can sort as 'asc' or 'desc'
            position: 'bottom', // position of your bars, can be 'bottom' or 'top'. 'top' doesn't work for multi type
            prefix: '', // text that will be shown before every label
            postfix: '', // text that will be shown after every label
            animate: true, // if you don't need animated appearance change to false
            speed: 2, // speed of animation in seconds
            legendWidth: 100, // width of your legend box
            legend: false, // if you want legend change to true
            legends: false, // array for legend. for simple graph type legend will be extracted from labels if you don't set this
            type: false, // for multi array data default graph type is stacked, you can change to 'multi' for multi bar type
            showValues: true, // you can use this for multi and stacked type and it will show values of every bar part
            showValuesColor: '#fff' // color of font for values 
});

Problem:
I would like to replace the hard numbers (e.g. 100000 & 200000) in the array with the output that is dumped into my HTML object. I’ve tried the following:

var TestVariable = <span id="one"></span>;
coolnessGraph = new Array(
                       [TestVariable,'ROI w/ Local Spending'],

and just about every other iteration of syntax I could think up to make the process work. I also tried waiting to fire the graph after the first calculation has been run.
Is there an error my logic?…syntax?…any help would be greatly be appreciated.

  • 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-27T15:15:57+00:00Added an answer on May 27, 2026 at 3:15 pm

    If I’m reading correctly, you only need to pass $('#one').text(), or a variation of that, into the array. Am I missing something?

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

Sidebar

Related Questions

This is a situation where I have a function that receives the number of
I have the following situation: I have a certain function that runs a loop
Here is the situation. I have some javascript that looks like this: function onSubmit()
I have a function that may take in a number or a list of
I have a situation in a code where there is a huge function that
Imagine such situation that I have a function like this: Object f() { Object
Having some issue with my function call please. I have a situation that I
Here's my situation: i have a dialog form that inserts some data on my
My situation is like this: I have a function that returns a value as
I have a function that calls .dialog on a dynamically generated element. The code:

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.