Angular Google Charts - 分組柱狀圖
以下是分組柱狀圖示例。
我們在 Google Charts 配置語法 章節中已經看到用於繪製圖表的配置。現在,讓我們看一個分組柱狀圖示例。
配置
我們使用 ColumnChart 類來顯示基於柱的圖表。
示例
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Population (in millions)';
type = 'ColumnChart';
data = [
["2012", 900, 390],
["2013", 1000, 400],
["2014", 1170, 440],
["2015", 1250, 480],
["2016", 1530, 540]
];
columnNames = ['Year', 'Asia','Europe'];
options = {};
width = 550;
height = 400;
}
結果
驗證結果。
angular_googlecharts_column_charts.htm
廣告