Google 圖表角 - 基本柱狀圖
以下是一個基本柱狀圖的示例。
我們在 Google 圖表配置語法 章節中看到了繪製圖表所用的配置。現在,我們來看一個基本柱狀圖的示例。
配置
我們已使用 BarChart 類來顯示基於柱狀的圖表。
type = 'BarChart';
示例
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 = 'BarChart';
data = [
["2012", 900],
["2013", 1000],
["2014", 1170],
["2015", 1250],
["2016", 1530]
];
columnNames = ['Year', 'Asia'];
options = { };
width = 550;
height = 400;
}
結果
驗證結果。
angular_googlecharts_bar_charts.htm
廣告