Angular-googlecharts-area-stacked
提供:Dev Guides
Google Angular Charts-積み上げ面グラフ
以下は積み上げ面グラフの例です
link:/angular_googlecharts/angular_googlecharts_configuration_syntax [Googleグラフの構成構文]の章で、グラフを描画するために使用される構成を既に確認しました。 次に、積み上げ面グラフの例を見てみましょう。
構成
*isStacked* 構成を使用して積み上げグラフを表示しました。
options = {
isStacked:true, hAxis: {
title: 'Year'
}
};
例
*_app.component.ts_*
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.componentl',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Area Chart';
type = 'AreaChart';
data = [
["2013", 1000, 400],
["2014", 1170, 460],
["2015", 660, 1120],
["2016", 1030, 540]
];
columnNames = ['Year', 'Sales',"Expenses"];
options = {
isStacked:true,
hAxis: {
title: 'Year'
}
};
width = 550;
height = 400;
}
結果
結果を確認します。