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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:23:40+00:00 2026-05-28T05:23:40+00:00

I have a Highchart’s graph that needs to be regenerated every minute. I was

  • 0

I have a Highchart’s graph that needs to be regenerated every minute. I was curious as to how one would refresh the following graph? http://pastebin.com/bEwkX8Fk

I thought perhaps just refreshing the div may be sufficient, but after further thought I realized that I’d probably have to initiate some kind of call from the controller to update the data for the graph. Any thoughts here as to the correct approach?

I am thinking now that perhaps updating it with the Highcharts json functionality would be best, but I’m not sure where to start yet there.

  • 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-28T05:23:41+00:00Added an answer on May 28, 2026 at 5:23 am

    You will want to setup an ajax request to the server that polls every X ms, preferably with jquery like this.

    var ajax_path = #{action_controller_path}
    function pollData() {
      $.ajax({
        type: 'get',
        url: ajax_path,
        success: function(data) {
          // update chart
          var series = chart.series[0],
                shift = series.data.length > 20; // shift if the series is longer than 20          
          chart.series[0].addPoint(data, true, shift);
    
          setTimeout(pollData, 60000) // Poll data every 60s
        }
      });
    }
    

    On the rails side you will then need to create a Controller#action to feed this ajax request, remember to set your your responds_to to include json. Something along the lines of this, please take this code “as is”:

    respond_to :json, only: [:polling_action]
    def polling_action
      @data_point = Model.get_data
      respond_with @data_point
    end
    

    I think the specifics of how to actually update the chart is stated in the article @nikita-beloglazov referenced: http://www.highcharts.com/documentation/how-to-use and here http://www.highcharts.com/ref/#series-object for the addPoint (Object options, [Boolean redraw], [Boolean shift], [Mixed animation]) api reference which is what you should call after you have loaded the data point with the ajax polling method.

    NOTE: Keep in mind polling data is not an very efficient process unless you know the interval at which the data is being updated. Considering you only need to update this data every 60s this is probably not an issue but just putting it out there for others that might stumble upon this.

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

Sidebar

Related Questions

I have the following set up: HighChart Graph -------------------- DataTable Header Month | Day
I have a highchart column graph, in that at some time the y axis
I have a highchart that I am generating the data for dynamically based on
I have a Javascript Highchart that I'm displaying and trying to get more information
I have a really strange behavior with highchart (via rails plugin): The graph display
I have the following C# code: public JsonResult Graph() { var result = new
I have a 100-frame animation in one div and a standard area highchart in
I have a Highchart scatter chart that plots data calculated using a PHP script.
I have the following code: http://jsfiddle.net/maniator/vTjW8/ var createChartTemplate = function() { return { chart:
Hi I have built a highchart 2.1.4 graph. the tooltip acts differently in IE9

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.