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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:18:57+00:00 2026-06-10T14:18:57+00:00

today i found it these chart service by google and i played around with

  • 0

today i found it these chart service by google and i played around with a little ans seem to go stuck and chart transition animation where i try 2 view two sets of different data on the same table which changes on button click, following is the code,

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <button type="button" id="b1">Click Me!</button> 
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <title>
  Google Visualization API Sample
  </title>
  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  <script type="text/javascript">
  google.load('visualization', '1', {packages: ['corechart']});
  </script>
  <script type="text/javascript">
  // Some raw data (not necessarily accurate)
var rowData1 = [['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua  Guinea',
                 'Rwanda', 'Average'],
                ['2004/05', 165, 938, 522, 998, 450, 114.6],
                ['2005/06', 135, 1120, 599, 1268, 288, 382],
                ['2006/07', 157, 1167, 587, 807, 397, 623],
                ['2007/08', 139, 1110, 615, 968, 215, 409.4],
                ['2008/09', 136, 691, 629, 1026, 366, 569.6]];
var rowData2 = [['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua  Guinea',
                 'Rwanda', 'Average'],
                ['2004/05', 122, 638, 722, 998, 450, 614.6],
                ['2005/06', 100, 1120, 899, 1268, 288, 682],
                ['2006/07', 183, 167, 487, 207, 397, 623],
                ['2007/08', 200, 510, 315, 1068, 215, 609.4],
                ['2008/09', 123, 491, 829, 826, 366, 569.6]];

// Create and populate the data tables.
var data = [];
data[0] = google.visualization.arrayToDataTable(rowData1);
data[1] = google.visualization.arrayToDataTable(rowData2);

var options = {
  width: 400,
  height: 240,
  vAxis: {title: "Cups"},
  hAxis: {title: "Month"},
  seriesType: "bars",
  series: {5: {type: "line"}},
  animation:{
    duration: 1000,
    easing: 'out'
  },
};
var current = 0;
// Create and draw the visualization.
var chart = new google.visualization.ComboChart(document.getElementById('visualization'));
var button = document.getElementById('b1');
function drawChart() {
  // Disabling the button while the chart is drawing.
  button.disabled = true;
  google.visualization.events.addListener(chart, 'ready',
      function() {
        button.disabled = false;
        button.value = 'Switch to ' + (current ? 'Tea' : 'Coffee');
      });
  options['title'] = 'Monthly ' + (current ? 'Coffee' : 'Tea') + ' Production by Country';

  chart.draw(data[current], options);
}
drawChart();

button.onclick = function() {
  current = 1 - current;
  drawChart();
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>

over here https://developers.google.com/chart/interactive/docs/animation?hl=nl-NL, please, i know this is a nooby question, but this doesn’t seem to work for me…i added references and everything but still doesn’t gave me anything, please any one could fix this code with html to work or give some information how to, i’d be much grateful 🙂 thank you very much. 🙂

  • 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-10T14:18:59+00:00Added an answer on June 10, 2026 at 2:18 pm

    No worries, I found the answer, i know this must be a very obvious answer, but this is for someone whoever might need help 🙂

        <html>
          <head>
         <button type="button" id="b1" onclick="init();" >Click me!</button>  
            <script type="text/javascript" src="https://www.google.com/jsapi"></script>
            <script type="text/javascript">
            google.load("visualization", "1", {packages:["corechart"]});
            google.setOnLoadCallback(init);
            function init(){
                  var rowData1 = [['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua  Guinea',
                             'Rwanda', 'Average'],
                            ['2004/05', 165, 938, 522, 998, 450, 114.6],
                            ['2005/06', 135, 1120, 599, 1268, 288, 382],
                            ['2006/07', 157, 1167, 587, 807, 397, 623],
                            ['2007/08', 139, 1110, 615, 968, 215, 409.4],
                            ['2008/09', 136, 691, 629, 1026, 366, 569.6]];
                var rowData2 = [['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua  Guinea',
                                 'Rwanda', 'Average'],
                                ['2004/05', 122, 638, 722, 998, 450, 614.6],
                                ['2005/06', 100, 1120, 899, 1268, 288, 682],
                                ['2006/07', 183, 167, 487, 207, 397, 623],
                                ['2007/08', 200, 510, 315, 1068, 215, 609.4],
                                ['2008/09', 123, 491, 829, 826, 366, 569.6]];
    
                // Create and populate the data tables.
                var data = [];
                data[0] = google.visualization.arrayToDataTable(rowData1);
                data[1] = google.visualization.arrayToDataTable(rowData2);
    
                var options = {
                  width: 400,
                  height: 240,
                  vAxis: {title: "Cups"},
                  hAxis: {title: "Month"},
                  seriesType: "bars",
                  series: {5: {type: "line"}},
                  animation:{
                    duration: 1000,
                    easing: 'out'
                  },
                };
                var current = 0;
                // Create and draw the visualization.
                var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
                var button = document.getElementById('b1');
                function drawChart() {
                  // Disabling the button while the chart is drawing.
                  button.disabled = true;
                  google.visualization.events.addListener(chart, 'ready',
                      function() {
                        button.disabled = false;
                        button.value = 'Switch to ' + (current ? 'Tea' : 'Coffee');
                      });
                  options['title'] = 'Monthly ' + (current ? 'Coffee' : 'Tea') + ' Production by Country';
    
                  chart.draw(data[current], options);
                }
                drawChart();
    
                button.onclick = function() {
                  current = 1 - current;
                  drawChart();
                }
            }
            </script>
          </head>
          <body>
            <div id="chart_div" style="width: 900px; height: 500px;"></div>
          </body>
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was playing around with include and extend today and found something I don't
I come across the google project http://www.20thingsilearned.com/ today and I found the canvas-based page
Today I found a very mysterious bug in the code. I have used the
Today I found LiquiBase project and I think it is very interesting. I would
Today I found the following: #include <stdio.h> int main(){ char x = 255; int
Today I found that my site was down...I turned the errors to off and
While searching a bug in my code today I found a strange thing. When
I was looking at a css file today and found the following rule set:
Googling today I couldn't found sample or mentioning of best practice: how to escape
Today, I found out that you can write such code in C++ and compile

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.