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

The Archive Base Latest Questions

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

Prior Information: (In case you are wondering where I am coming from) First Question:

  • 0

Prior Information: (In case you are wondering where I am coming from)

First Question: How to set a JS variable every n sec to a JSON array.

Thanks to help got that all going well 🙂

I then worked on limiting the total amount in the array, tried to set it to 10 but every time it would stop at 7.. with help from here got this working nicely.

Second Question: How to limit a native JSON array to 10 places.

Again working perfectly..


Question:

Now I am stuck at a stage where I have got my JSON array formatting into the exact context I would like. e.g: [[“0”, “7”], [“0”, “7”], [“0”, “7”]]
And I am aiming on plotting this into a Jquery Flot Graph. Now if I manually set a variable of:

var PlotData= [["0", "7"], ["0", "7"], ["0", "7"]]

Jquery Flot will plot this perfectly but as an incrementing value that starts at null it will add a blank graph then never refresh it. My code is as follows:

var numbers = [];
var jsonString = "";
var PlotData;

function EveryOneSec() {
  if (numbers.length == 10) {
      numbers.shift();
  }
  numbers.push(['0", "' Math.random()]);
  jsonString = JSON.stringify({'numbers': numbers});
  PlotData = numbers; //set to numbers for now rather than the JSON just for testing.
  $.plot($("#PlaceHolder"), [{ data: PlotData, points: { show: true}}]);
  setTimeout(EveryOneSec, 1000);
}

Now the function runs every sec. But will not update the Plot. Does anyone know what I am missing or what I have to do to be able to Dynamically update the Jquery Flot Graph?

  • 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-15T18:10:27+00:00Added an answer on May 15, 2026 at 6:10 pm

    try something like this…

    $.plot($("#PlaceHolder"), PlotData, {points: { show: true}});
    

    also I think, you got unpaired quotes here

    numbers.push(['0", "' Math.random()]); // typo? should it be like ["0", Math.random()]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that records information from an inverter roughly every 15 minutes.
I deleted my prior question dealing with the subject as the context has changed
I am attempting to pass information from a task created within a workflow to
I noticed prior to posting this question that there have been similar questions posted
The following information is from page 270 of the web2py book: person = db.person(id)
I am extracting information about certain companies from Reuters using Python. I have been
Prior to C++11, if I had a function that operated on large objects, my
Prior to the asp.net 4 RC update, I had been using the WebApi for
Prior to Excel 2007, we used to catch the open file event in Excel
Prior to Rails 3, creating a plugin to extend find was relatively easy: basically

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.