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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:20:07+00:00 2026-05-28T20:20:07+00:00

I am trying to load highcharts dynamically as shown in below code: It is

  • 0

I am trying to load highcharts dynamically as shown in below code: It is not able to recognize highcharts variable. If I load highcharts by static means, it works. Please help.

I am using jquery version 4 and highcharts latest version 1.0

<html>
<head>
//loading jquery
<script src="js/libs/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
var chart1;

$(document).ready(function() {
$.getScript('js/libs/highcharts.src.js', function() {

            });


  chart1 = new Highcharts.Chart({
         chart: {
            renderTo: 'chart1',
            type: 'bar'
         },
         title: {
            text: 'Fruit Consumption'
         },
         xAxis: {
            categories: ['Apples', 'Bananas', 'Oranges']
         },
         yAxis: {
            title: {
               text: 'Fruit eaten'
            }
         },
         series: [{
            name: 'Jane',
            data: [1, 0, 4]
         }, {
            name: 'John',
            data: [5, 7, 3]
         }]
      });
   });


</script>


</head>

<body>
<div id="chart1"></div>

</div>
</body>
</html>
  • 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-28T20:20:07+00:00Added an answer on May 28, 2026 at 8:20 pm

    $.getScript() is an asynchronous operation, meaning it will go fetch the script but won’t wait for it to be done before processing the rest of the code. Therefore you need to wait for some sort of indication that the code has been retrieved. If you look at the docs you will notice that $.getScript() has a success callback function just for this purpose. In fact, you already have an empty success function in your code, just move the Highcharts declaration there. In other words, do this:

    $(document).ready(function() {
        $.getScript('js/libs/highcharts.src.js', function() {
            chart1 = new Highcharts.Chart({
                // Highcharts options
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to load SFmpq.dll via this code static { Native.setProtected(true); System.setProperty(jna.library.path, new File(lib).getAbsolutePath());
While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not
I am trying to load UIImage object from NSData , and the sample code
I am trying to load properties from a file (test.properties) The code I use
I'm actually trying load image based on its screen size. Code seems to be
I'm trying to load my ListView from the following array static final String[][] Bookings
Trying to load a local file into a webbrowser control but this does not
I'm trying to load a java .class file dynamically and call it by reflection.
I am trying load map region and MKMapView delegate methods are not being called
Trying to load generic.xaml in code but it throws a XamlParseException. Code as follows:

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.