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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:34:41+00:00 2026-06-06T09:34:41+00:00

hi i need to have a graph in my html page after searching for

  • 0

hi i need to have a graph in my html page after searching for long time i came to know that using jqBarGraph plug-in it is easy to create the graph ,Below given is the code for my page :

<html>
<head><script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jquery.js"></script>
<script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jqBarGraph.js"></script>

   <script type="text/javascript">

 arrayOfData = new Array(
     [10.3,'Jan','#f3f3f3'],
     [15.2,'Feb','#f4f4f4'],
     [13.1,'Mar','#cccccc'],
     [16.3,'Apr','#333333'],
     [14.5,'May','#666666']
);
   $('#divForGraph').jqBarGraph({ data: arrayOfData });

   </script>
   </head>
   <body>
   <div id="divForGraph" style="width:100%; height:100%; border:1px solid black;">
   aksdljfkladsjf;oajsdfkmlmnmnk;asdf
   </div>
   </body>
   </html>

what is the mistake i’ve done in this code and correct me in getting the graph in this page asap….thanks in advance.

  • 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-06T09:34:42+00:00Added an answer on June 6, 2026 at 9:34 am

    You have to wait until the Div is loaded to manipulate the div contents using jQuery / jqgraph.

    Place your script after the div is loaded.

    Also the CSS style file is missing, I added that.

    The below fixed code works.

    <html>
    <head><script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jquery.js"></script>
    <script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jqBarGraph.js"></script>
    <link rel="stylesheet" href="http://www.workshop.rs/jqbargraph/styles.css" type="text/css" />
       </head>
       <body>
       <div id="divForGraph" style="width:100%; height:100%; border:1px solid black;">
       </div>
       <script type="text/javascript">
    
     arrayOfData = new Array(
         [10.3,'Jan','#f3f3f3'],
         [15.2,'Feb','#f4f4f4'],
         [13.1,'Mar','#cccccc'],
         [16.3,'Apr','#333333'],
         [14.5,'May','#666666']
    );
       $('#divForGraph').jqBarGraph({ data: arrayOfData });
    
       </script>
       </body>
       </html>
    

    There is another fix fir this without moving your scripts to the bottom of the page. Alternatively, you can also use jQuery’s $(document).ready() to wait until the document is loaded and then run your jqBar script!

    <html>
    <head><script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jquery.js"></script>
    <script type="text/javascript" src="http://www.workshop.rs/jqbargraph/jqBarGraph.js"></script>
    <link rel="stylesheet" href="http://www.workshop.rs/jqbargraph/styles.css" type="text/css" />
    
       <script type="text/javascript">
    $(document).ready(function() {
       $('#divForGraph').jqBarGraph({ data: arrayOfData });
    
    });
     arrayOfData = new Array(
         [10.3,'Jan','#f3f3f3'],
         [15.2,'Feb','#f4f4f4'],
         [13.1,'Mar','#cccccc'],
         [16.3,'Apr','#333333'],
         [14.5,'May','#666666']
    );
    
       </script>
       </head>
       <body>
       <div id="divForGraph" style="width:100%; height:100%; border:1px solid black;">
       </div>
    
       </body>
       </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML that looks like this: $(document).ready(function(){ $('#cumulative-returns').graph({ width: 400, height: 180,
I have a graph with an s and t vertex that I need to
I need to show a graph(piegraph and XYgraph) in HTML file. I have used
I have a directed graph with ~20 nodes that I need to have their
I have a graph representing users and some articles they wrote. I need to
I need to have a linked text inside a svg graph. Here is what
I have need for a function pointer that takes two arguments and returns a
I need to have custom checkboxes which wasn't that tricky. I made checkbox_selector to
I'm searching for a way to create complex/simple graph using Perl. The known modules/applications
I'm writing a Java application that will run for a long time (essentially, it

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.