- Google 圖表教程
- Google 圖表 - 主頁
- Google 圖表 - 概覽
- Google 圖表 - 環境設定
- 配置語法
- Google 圖表 - 區域圖表
- Google 圖表 - 條形圖表
- Google 圖表 - 氣泡圖表
- Google 圖表 - 日曆圖表
- Google 圖表 - K 線圖
- Google 圖表 - 柱形圖
- Google 圖表 - 組合圖表
- Google 圖表 - 直方圖圖表
- Google 圖表 - 折線圖
- Google 圖表 - 地圖
- Google 圖表 - 組織結構圖
- Google 圖表 - 餅狀圖
- Google 圖表 - 桑基圖
- Google 圖表 - 散點圖
- 階梯區域圖表
- Google 圖表 - 表格圖表
- Google 圖表 - 時間線圖表
- Google 圖表 - 樹狀圖圖表
- Google 圖表 - 趨勢線圖表
- Google 圖表實用資源
- Google 圖表 - 快速指南
- Google 圖表 - 實用資源
- Google 圖表 - 討論
直方圖圖表多重序列
以下是一個包含多重序列的直方圖圖表的示例。我們已經看到Google 圖表配置語法章節中用來繪製此圖表的配置。因此,讓我們來看一個完整的示例。
示例
googlecharts_histogram_multiple.htm
<html>
<head>
<title>Google Charts Tutorial</title>
<script type = "text/javascript" src = "https://www.gstatic.com/charts/loader.js">
</script>
<script type = "text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<body>
<div id = "container" style = "width: 550px; height: 400px; margin: 0 auto">
</div>
<script language = "JavaScript">
function drawChart() {
// Define the chart to be drawn.
var data = google.visualization.arrayToDataTable([
['Student Roll No', 'Height', 'Weight'],
['1', 80, 40],['2', 55, 30],['3', 68, 34],['4', 80, 40],['5', 54, 27],
['6', 70, 35],['7', 85, 42],['8', 78, 40],['9', 70, 35],['10', 58, 28],
['11', 90, 45],['12', 65, 33],['13', 88, 50],['14', 82, 41],['15', 65, 30],
['16', 86, 43],['17', 45, 30],['18', 62, 30],['19', 84, 42],['20', 75, 40],
['21', 82, 41],['22', 75, 40],['23', 58, 30],['24', 70, 35],['25', 85, 40]
]);
// Set chart options
var options = {
title: 'Students Height and Weight',
legend: { position: 'bottom' }
};
// Instantiate and draw the chart.
var chart = new google.visualization.Histogram(document.getElementById('container'));
chart.draw(data, options);
}
google.charts.setOnLoadCallback(drawChart);
</script>
</body>
</html>
結果
驗證結果。
googlecharts_histogram_charts.htm
廣告