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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:14:28+00:00 2026-05-28T00:14:28+00:00

I have a chart that I would like to update whenever a form on

  • 0

I have a chart that I would like to update whenever a form on the same page is submitted. The var chart = new Highcharts.Chart(options) expression works fine by itself (it draws a chart). When I put it inside the callback function for the .click() event, when I click the corresponding submit button, the updated plot flashes on the screen for a second and is then erased and replaced by the original plot.

I’m so close to doing what I need to, but I’m stumped by this. Thanks for your help.

Libraries:

<link type="text/css" href="css/cupertino/jquery-ui-1.8.16.custom.css" rel="stylesheet" />      
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>

Here is the Javascript:

<script>
  $(function() {
$("#lines").val(),colors: $("#colors").val(),},
var options = {
    chart : {
        renderTo : 'container',
        defaultSeriesType: 'line',
        zoomType: 'xy' },
    title : { text : 'Foo' },
    xAxis: { title: { text: 'x label'  } },
    yAxis: { title: { text: 'y label' } },
    series : {}
}
    var chart = new Highcharts.Chart(options);
    $( "#submit" ).click(function() {
    options.series = [{"name": 10402, "color": "rgba(255,139,0,0.5)", "data": [[ 146,55.8 ],[150,60.9]]},{"name": 10403, "color": "rgba(255,255,0,0.5)", "data": [[ 130,25.8 ],[150,54.9]]}];
    var chart = new Highcharts.Chart(options);
    });

  });
  </script>

Here is the HTML body:

<body>
<form name="chartform" id="chartform">
<input type="submit" id="submit" /><br />
</form>
<div id="container" style="width: 100%; height: 800px"></div>
</body>

This is driving me nuts.

  • 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-28T00:14:29+00:00Added an answer on May 28, 2026 at 12:14 am

    This is working fine for me:

    var chart;
    $(document).ready(function() {
        options ={ 
            chart: {
             renderTo: 'container',
             defaultSeriesType: 'line',
             zoomType: 'xy'
          },
                   title : { text : 'Foo' },
                    xAxis: { title: { text: 'x label'  } },
        yAxis: { title: { text: 'y label' } },
    
            series: {}
                  };
    
       chart = new Highcharts.Chart(options);
       series3 = [{"name": 10402, "color": "rgba(255,139,0,0.5)", data: [[ 146,55.8 ],[150,60.9]]},{"name": 10403, "color": "rgba(255,255,0,0.5)", "data": [[ 130,25.8 ],[150,54.9]]}];
       series2 = [{
             name: '1042',
             color: "rgba(255,139,0,0.5)",
             data: [[ 146,55.8 ],[150,60.9]]
          }, {
             name: '10403',
              color: "rgba(255,255,0,0.5)",
             data: [[ 130,25.8 ],[150,54.9]]
          }];
        $( "#chartform" ).submit(function() {
        options.series = series3;
        var chart = new Highcharts.Chart(options);
    return false;
        });
    
    
    });
    

    EDIT: I believe the problem is that you are submitting the form. Do a return false and use submit handler instead of click. You can check it live in: http://jsfiddle.net/bCFHL/157/

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

Sidebar

Related Questions

I have a line series chart called lineSeries1. I would like that chart to
I have a function that I would like to be able to return special
I have a DataGridView . I would like to update another cell on the
I have a line chart that is updated every so and so seconds, similar
I have a chart with a series that denotes a large set (1000's) of
I have a chart (in bitmap format) that I'm trying to render to a
I have some code that generates image of a pie chart. It's a general
I have a simple cart page that displays items that are in someones cart,
I'm creating a custom charting control and I would like to have the possibility
I have features I would like to be portable between my own Rails applications.

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.