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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:29:30+00:00 2026-05-25T09:29:30+00:00

I’m trying to do the following: Get some data from the backend and bind

  • 0

I’m trying to do the following: Get some data from the backend and bind it with a JQplot candlestick chart.

What i’ve accomplished:

  • The data is being generated in the backend
  • The data is being procured by using the $.get() function of jQuery.

So heres the problem:

The data , if i bind it to a variable by doing:

CASE I_
ohlc = [['2011-01-03 09:30:00',325.7,325.99,324.82,325.39],['2011-01-03 09:35:00',325.44,326.74,325.4,326.46],['2011-01-03 09:40:00',326.54,327.38,326.38,327.23]];

case 1 log screenshot

It works like a breeze.

But when i use

CASE II_
$.get('MYSERVLET', function(data){
ohlc = data;
});

Case 2 log screenshot

and the chart is generated , i get an error at the console saying:

Uncaught #<Object>
init
w.jqplot
(anonymous function)
jQuery.event.handle
jQuery.event.add.elemData.handle.eventHandle

Also when i do a console.log in CASE I , i get them as arrays. But in CASE II , it looks like normal data . I dont know if thats of any help but i noticed this.

Does anyone know how to fix this? What am i doing wrong?

  • 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-25T09:29:30+00:00Added an answer on May 25, 2026 at 9:29 am

    For jqplot the data has to be in array form. You probably have to check what is the format of data you are getting in case 2. If it is not in array format then inside the $.get function you may have to write some custom code which will convert it into array format.

    CASE II_
    $.get('MYSERVLET', function(data){
    var temp = data;
    //code to convert data to array format
    //populate ohlc.
    });
    

    EDIT:

    The array similar to 1st case can be generated using 2 for loops

    ohlc=[];
    for(int l1=0;l1<data.length;l1++)
    {
    var temp = [];
    for(int l2=0;l2<data[l1].length;l2++)
    {
    temp.push(data[li][l2]);
    }
    ohlc.push(temp);
    }
    

    And as Shortstick suggested the chart has to be drawn only after the data is returned from the get method.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.