copying code in Google site

30 views
Skip to first unread message

Irfan

unread,
Oct 29, 2011, 5:09:30 AM10/29/11
to Google Visualization API
how can I copy the code for dashboards created in the visualization
play ground in my google website. I tried to copy the same by clicking
the Edit button and then copying the code to the html screen but it is
not working. Kindly guide me the procedure or what I am doing wrong.
thanks.

Roni Biran

unread,
Oct 30, 2011, 1:15:03 AM10/30/11
to google-visua...@googlegroups.com
What you described is the exact method to copy the playground code. Make sure the code is the exact one. You can do that by copying the code via notepad. Save the file with htm/html extension and that's it.
If this does not work, please post the code so we all see and try ourselves.

Good luck 
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Oct 31, 2011, 8:40:30 AM10/31/11
to google-visua...@googlegroups.com
Make sure you are copying the HTML, not just the javascript (click the 'Edit HTML' button to see all of the code).

Muhammad Azam

unread,
Nov 1, 2011, 4:50:41 AM11/1/11
to google-visua...@googlegroups.com
actually what I was trying to say that I need to show the google dashboard (see below code) in my google site. How can I do that. I am not an IT expert/developer. when I simply copy the below code in the HTML section of my google site, it does not work. How can I show this interactive dashboard on my google site. can you guide me exactly what I have to to do. 
thanks. regards
Irfan

function drawVisualization({
  // Prepare the data
  var data google.visualization.arrayToDataTable([
    ['Name''Gender''Age''Donuts eaten'],
    ['Michael' 'Male'125],
    ['Elisa''Female'207],
    ['Robert''Male'73],
    ['John''Male'542],
    ['Jessica''Female'226],
    ['Aaron''Male'31],
    ['Margareth''Female'428],
    ['Miranda''Female'336]
  ]);  
  
  // Define a slider control for the Age column.
  var slider new google.visualization.ControlWrapper({
    'controlType''NumberRangeFilter',
    'containerId''control1',
    'options'{
      'filterColumnLabel''Age',
    'ui'{'labelStacking''vertical'}
    }
  });

  // Define a category picker control for the Gender column
  var categoryPicker new google.visualization.ControlWrapper({
    'controlType''CategoryFilter',
    'containerId''control2',
    'options'{
      'filterColumnLabel''Gender',
      'ui'{
      'labelStacking''vertical',
        'allowTyping'false,
        'allowMultiple'false
      }
    }
  });

  // Define a Pie chart
  var pie new google.visualization.ChartWrapper({
    'chartType''PieChart',
    'containerId''chart1',
    'options'{
      'width'300,
      'height'300,
      'legend''none',
      'title''Donuts eaten per person',
      'chartArea'{'left'15'top'15'right'0'bottom'0},
      'pieSliceText''label'
    },
    // Instruct the piechart to use colums 0 (Name) and 3 (Donuts Eaten)
    // from the 'data' DataTable.
    'view'{'columns'[03]}
  });

  // Define a table
  var table new google.visualization.ChartWrapper({
    'chartType''Table',
    'containerId''chart2',
    'options'{
      'width''300px'
    }
  });

  // Create a dashboard
  new google.visualization.Dashboard(document.getElementById('dashboard')).
      // Establish bindings, declaring the both the slider and the category
      // picker will drive both charts.
      bind([slidercategoryPicker][pietable]).
      // Draw the entire dashboard.
      draw(data);
Reply all
Reply to author
Forward
0 new messages