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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:11:13+00:00 2026-05-25T14:11:13+00:00

I am using jqPlot javascript library ( http://www.jqplot.com/ ) for graphs and charts in

  • 0

I am using jqPlot javascript library ( http://www.jqplot.com/ ) for graphs and charts in one of my application.

In my application, there are 5-6 pages where this library is used. But I would like to discuss one particular case here.

On 1 of page, I am loading 3 charts. Data for these 3 charts is populated from database tables.

There is different set of queries for each chart. So, populated data for each chart is different too.

Once I have populated data, I have to process it, before providing its input to chart.

What is the problem then:
Problem that I am facing is it takes lots of time for page to render on browser (which is quiet obvious, as first it will form query, then fire that query against database tables, get the data, process on data and give to chart)

One of my friend suggested to implement following thing using ajax. I really liked his solution.

This is what I intend to do:

I would create a page, which will load all the required js/css files for jqPlot library.
There will be 3 sections on that page, where I would put some GIF images indicating that some process is going on (say ajax-loader.gif)

Once page is loaded, it will fire 3 ajax call, one at a time, to fetch each chart.

My Question Is how can I load chart from data received from ajax-call?

jqplot puts data and creates chart in following way (look at example below)

<script class="code" type="text/javascript"> 
$(document).ready(function(){
  var plot2 = $.jqplot ('chart2', [[3,7,9,1,4,6,8,2,5]], {
      // Give the plot a title.
      title: 'Plot With Options',
      // You can specify options for all axes on the plot at once with
      // the axesDefaults object.  Here, we're using a canvas renderer
      // to draw the axis label which allows rotated text.
      axesDefaults: {
        labelRenderer: $.jqplot.CanvasAxisLabelRenderer
      },
      // An axes object holds options for all axes.
      // Allowable axes are xaxis, x2axis, yaxis, y2axis, y3axis, ...
      // Up to 9 y axes are supported.
      axes: {
        // options for each axis are specified in seperate option objects.
        xaxis: {
          label: "X Axis",
          // Turn off "padding".  This will allow data point to lie on the
          // edges of the grid.  Default padding is 1.2 and will keep all
          // points inside the bounds of the grid.
          pad: 0
        },
        yaxis: {
          label: "Y Axis" 
        }
      }
    });
});
</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-05-25T14:11:13+00:00Added an answer on May 25, 2026 at 2:11 pm

    Since you’re using jQuery, you’d use the jQuery Ajax method to fetch the chart data after the page has loaded.

    In your success function, your JS code (on the browser) receives the data from your server. Once you have the data, make the call to $.jqplot — passing in the data you’ve just received.

    To initially show the busy gif, just use the img element as the static content of the chart2 div which will later be the graph’s container.

    Some tips:

    • Some browsers don’t do well at handling an animated gif while running a js program. So you may want to try a text message (“Loading chart…”) in addition to the rotating gif. — Or update the text messages. Eg start with “Fetching chart data from server” then update to “Processing chart data” once your success function has been called.

    • Rather than starting all 3 Ajax calls at once, experiment with having the success function for the first chart initiating the second Ajax call. (In addition to it charting the data.)

    If you have problems with your Ajax calls, Google for examples and ask a separate question on SO if you still have problems.

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

Sidebar

Related Questions

Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using Javascript, is there a standard way to get the absolute path of an
Im using jqplot to draw some charts. It is a great tool, but it
I'm using jqplot to generate charts. It works fine when I define the source
I'm using jqPlot and I need to turn this JSON which I receive from
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using JDeveloper , I started developing a set of web pages for a project
I am using jqPlot to show candlestick chart and the data is from XML
Using jQuery's UI Tabs. This is my code. <div id=tabs> <ul> <li><a href=#tabs-1>Find a

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.