
Want to show dual google chart with different data and different dashboard in one page, but just only one can show in one page?
First Dashboard :
<html>
<head>
<title>Google Charts Tutorial</title>
</script>
<script type = "text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<body>
<div id = "container" style = "width: auto; height: 450px; margin: 0 auto">
</div>
<script language = "JavaScript">
function drawChart() {
// Define the chart to be drawn.
var data = google.visualization.arrayToDataTable([
['Fruit', 'Mount', { role: 'annotation'} ,'weight', { role: 'annotation'}],
['Apple', 1000,'1000', 245, '245'],
['Mango', 1234,'1234', 234,'234'],
['Watermelon', 12345,'12345', 342,'342'],
['Pineapple', 7321,'7321', 545,'545'],
['Grape', 46723,'46723', 2345,'2345'],
['Banana', 9643,'9643', 462,'462'],
['Orange', 4684,'4684', 235,'235']
]);
var options = {title: 'About Fruit', isStacked:true};
// Instantiate and draw the chart.
var chart = new google.visualization.BarChart(document.getElementById('container'));
chart.draw(data, options);
}
google.charts.setOnLoadCallback(drawChart);
</script>
</body>
</html>
Second Dashboard :
<html>
<head>
<title>Google Charts Tutorial</title>
</script>
<script type = "text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<body>
<div id = "container" style = "width: auto; height: 450px; margin: 0 auto">
</div>
<script language = "JavaScript">
function drawChart() {
// Define the chart to be drawn.
var data = google.visualization.arrayToDataTable([
['Vegetables', 'Mount', { role: 'annotation'} ,'Weight', { role: 'annotation'}],
['Cabbage', 117021,'117021', 134, '134'],
['Celery ', 1673407,'1673407', 194,'194'],
['Asparagus', 152139,'152139', 192,'192'],
['Cucumber', 180718,'180718', 216,'216'],
['Onion', 14214,'14214', 168,'168'],
['Pumpkin', 183667,'183667', 215,'215'],
['Sprout ', 15956,'15956', 118,'118']
]);
var options = {title: 'About Vegetables', isStacked:true, is3D: true,};
// Instantiate and draw the chart.
var chart = new google.visualization.BarChart(document.getElementById('container'));
chart.draw(data, options);
}
google.charts.setOnLoadCallback(drawChart);
</script>
</body>
</html>