mirror of
https://github.com/TBEDP/datavjs.git
synced 2026-01-25 15:07:00 +00:00
30 lines
799 B
HTML
30 lines
799 B
HTML
<html>
|
|
<head>
|
|
<script src="https://www.google.com/jsapi"></script>
|
|
<script>
|
|
google.load("visualization", "1", {packages:["corechart"]});
|
|
google.setOnLoadCallback(drawChart);
|
|
function drawChart() {
|
|
var data = google.visualization.arrayToDataTable([
|
|
['Task', 'Hours per Day'],
|
|
['Work', 11],
|
|
['Eat', 2],
|
|
['Commute', 2],
|
|
['Watch TV', 2],
|
|
['Sleep', 7]
|
|
]);
|
|
|
|
var options = {
|
|
title: 'My Daily Activities'
|
|
};
|
|
|
|
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
|
|
chart.draw(data, options);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="chart_div" style="width: 900px; height: 500px;"></div>
|
|
</body>
|
|
</html>
|