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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:12:38+00:00 2026-06-18T07:12:38+00:00

I need to update the chart every time the user selects values from some

  • 0

I need to update the chart every time the user selects values from some drop down menus and submit them.

I am writing Python scripts to handle the selected options and fetch the data from a database based on the user’s selections, then pass the data to the HTML with string replacement technique. The javascript takes the data from Python and the google chart API is used to generate the chart.

But this works only once. After the first time, the user selects and submits the selections, the chart remain unchanged. I can see the data is correct using firebug tool.

Can somebody help me on that? Thank you!

Below is my javascripts:

script src="http://www.google.com/jsapi?key=ABQIAAAA1Vvq5pLyw5IAAQQtCIurLhSCGfxgLuOmAJcC-OBbFOMYrpib_BSypK7Qf_9YkaT-2SzpuOBRKp6Bqw" type="text/javascript"></script>
    <script type="text/javascript">
      google.load("jquery", "1.3.2");
    </script>

      <!--Load the AJAX API-->
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
            google.load('visualization', '1', {packages: ['corechart']});
        </script>
        <script type="text/javascript">
            google.setOnLoadCallback(drawVisualization);
            function drawVisualization() {
                        var data = new google.visualization.DataTable();
                        {%if chart_Data%}
                            data.addColumn('string','Date Time');
                            data.addColumn('number','Wireless Mini CCB Controls');
                            data.addColumn('number','FNX App Controls');
                            data.addColumn('number','Hoist Status');
                            data.addRows({{chart_Data}});

                            //var data = google.visualization.arrayToDataTable({{chart_Data}});

                        var options = {
                                title: 'Status of Hoists',
                                vAxis: {title: 'Status of Hoists'},
                                isStacked: true
                        };

                            var chart = new google.visualization.SteppedAreaChart(document.getElementById('status_chart'));
                            chart.draw(data, options);
                        {% endif %}
  }

Below is my function to handle the drop down list menu selection and send “GET” request to my Python handler, which will return a replacement string {{chart_Data}}:

function monitorHoist(hoist_to_monitor,month,day,year){

            var hoist_to_monitor_text = document.getElementById('hoist_to_monitor').options[document.getElementById('hoist_to_monitor').selectedIndex].value
            var month_text = document.getElementById('month').options[document.getElementById('month').selectedIndex].value
            var day_text = document.getElementById('day').options[document.getElementById('day').selectedIndex].value
            var year_text = document.getElementById('year').options[document.getElementById('year').selectedIndex].value
            $.ajax({
            type: 'GET',  
            url: '/all?command=monitor&hoist_to_monitor=' + hoist_to_monitor_text +'&month='+month_text+'&day='+day_text+'&year='+year_text,
            //data: hoist_to_monitor_text,month_text,day_text,year_text,
            timeout: 60000,
            success: function(data) {
              $("#status").html('Success in sending request.');
              //drawVisualization();
            },
            error: function(XMLHttpRequest, textStatus, errorThrown) {
              $("#status").html('Timeout sending request.');
            }
        });
      }

Below is the division of the chart:

<div id='status_chart' style="width: 900px; height: 500px;"></div> 
  • 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-06-18T07:12:39+00:00Added an answer on June 18, 2026 at 7:12 am

    The problem is that you are not parsing the reqId value of the tqx field (See Implementing the ChartTools Datasource protocol).

    If you use the gviz_api (https://code.google.com/p/google-visualization-python/), then you have to pass the value req_id to the method ToJsonResponse.

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

Sidebar

Related Questions

I'm working on some bar charts and need to update the chart values. The
I need to update a form in AX to use a complex drop down
I need to update my .htaccess file to redirect permanently all URLs from http://example.com/pages/5604/article/something/?page=299
I need to update time info in a DateTime. I get a string in
I need to update a json list of object via url post data. For
I need to update the Notes field in my table tblMain by concatenating the
I need to update the META-INF.MF file of war The problem is My war
I need to update more than one update statements, but all should work on
I need to update an existing SharePoint content type by adding a new field
I need to update the primary key for a record but it's also the

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.