animations within dashboard

72 views
Skip to first unread message

fob...@gmail.com

unread,
Jun 9, 2016, 12:32:38 PM6/9/16
to Google Visualization API
Hi,

New to google charts and exploring sample code to check I can replicate functionality.

I am unable to get my column chart to animate from within a dashboard wrapper.

Anyone tell me what I'm doing wrong?

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">

      // Load the Visualization API and the controls package.
      google.charts.load('current', {'packages':['bar', 'controls']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.charts.setOnLoadCallback(drawDashboard);

      // Callback that creates and populates a data table,
      // instantiates a dashboard, a range slider and a pie chart,
      // passes in the data and draws it.
      function drawDashboard() {

   
         var data = google.visualization.arrayToDataTable([
       ['Date Sort', 'Date','Act_No', 'Activity','sub_no', 'Subject','Duration', 'Location_no','Location', 'Day','Colleague', 'Phase'],
       [20160608,new Date(2016,06,08),3,'Class Teaching',2,'Reading',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
       [20160608,new Date(2016,06,08),3,'Class Teaching',3,'Writing',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
       [20160608,new Date(2016,06,08),3,'Class Teaching',4,'Mathematics',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
       [20160608,new Date(2016,06,08),3,'Class Teaching',5,'Science',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
       [20160609,new Date(2016,06,09),3,'Class Teaching',2,'Reading',60,1,'In-School','Tuesday','Colleague A','Key Stage One'],
       [20160609,new Date(2016,06,09),3,'Class Teaching',3,'Writing',60,1,'In-School','Tuesday','Colleague A','Key Stage One'],
       [20160609,new Date(2016,06,09),3,'Class Teaching',4,'Mathematics',60,1,'In-School','Tuesday','Colleague A','Key Stage One']
       ]); // 'false' means that the first row contains labels, not data.
        
        // Create a dashboard.
        var dashboard = new google.visualization.Dashboard(
            document.getElementById('dashboard_div'));


var control = new google.visualization.ControlWrapper({

'controlType': 'CategoryFilter',
'containerId': 'filter_div',


 'options': {       
'filterColumnIndex': 5,
 
'ui': {
'allowTyping': false,
'allowMultiple': true, 
'selectedValuesLayout': 'aside'
 }
},
 
'state': {'selectedValues': []}
});

      
       // Create a pie chart, passing some options
        var pieChart = new google.visualization.ChartWrapper({
          'chartType': 'Bar',
          'containerId': 'chart_div',
        
        'options': {
        'chart': { 'title': 'Density of Precious Metals, in g/cm'},
        'width': 600,
        'height': 300,
        'bar': {'groupWidth': '85%'},
        'legend': { 'position': 'left' },
        'animation':{ 'duration': 6000, 'easing': 'linear','startup': 'true'}

          },
          
          'view': {'columns': [5, 4]}
          
        });

              dashboard.bind(control, pieChart);

        // Draw the dashboard.
        dashboard.draw(data);
      }
    </script>
  </head>

<body>
    <!--Div that will hold the dashboard-->
    <div id="dashboard_div">
      <!--Divs that will hold each control and chart-->
      <div id="filter_div"></div>
      <div id="chart_div"></div>
    </div>
  </body>
</html>

Daniel LaLiberte

unread,
Jun 9, 2016, 4:15:53 PM6/9/16
to Google Visualization API
I believe we have a fix for the animation problem in dashboards in the 'upcoming' release.  Just change your 'current' to 'upcoming'.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/43b2e654-810e-428e-8d48-29b324d4daa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

fob...@gmail.com

unread,
Jun 10, 2016, 6:10:29 AM6/10/16
to Google Visualization API
Thanks for your suggestion.

That hasn't worked and the input on the control hasn't rendered. (See attached screenshot)

Any further ideas?

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

Daniel LaLiberte

unread,
Jun 10, 2016, 9:42:04 AM6/10/16
to Google Visualization API
I missed that you are using the Material charts.  Animation isn't supported at all yet for those.  You might want to use the theme: 'material' option with corechart instead. 

Thanks for your suggestion.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.



--

fob...@gmail.com

unread,
Jun 12, 2016, 4:45:23 PM6/12/16
to Google Visualization API
Thanks for your help!!!!.

I do see animation with the 'corecharts' package.

Interestingly these only work with 'current' selected. Using 'upcoming' produces the error I  shared in the screenshot earlier in this thread.

Thanks for your suggestion.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--
Reply all
Reply to author
Forward
0 new messages