Hi,
I'm a new google chart's user and I need help.
I have a chart and a table and need that when I select a pie in the chart,
this value filter what table shows.
I have this code:
<html>
<head>
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Categorias', 'Cantidad'],
['Hombres', 3],
['Mujeres', 2],
['Niños', 1]
]);
var options = {
title: 'Categorias'
};
var chart = new
google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
google.load('visualization', '1', {packages:['table']});
google.setOnLoadCallback(drawTable);
function drawTable() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Nombre');
data.addColumn('number', 'Edad');
data.addColumn('string', 'Categorias');
data.addRows([
['José Luis', 43, 'Hombres'],
['Raquel', 36, 'Mujeres'],
['Diana', 3, 'Niños'],
['Diego', 98, 'Hombres'],
['Consuelo', 69, 'Mujeres'],
['Javier', 40, 'Hombres']
]);
var table = new
google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true});
}
</script>
</head>
<body>
<div id="piechart" style="width: 900px; height: 500px;"></div>
<div id='table_div'></div>
</body>
</html>
May anybody help me?
Thank you
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.