帶有負值的面積圖
以下是有負值的面積圖的示例。
我們已經瞭解了在谷歌圖表配置語法章節中繪製圖表所使用的配置。現在,我們來看看帶負值的面積圖的示例。
配置
我們已經使用AreaChart類來顯示基於面積的圖表和負值。
type='AreaChart';
示例
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
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 = { };
width = 550;
height = 400;
}
結果
驗證結果。
angular_googlecharts_area_charts.htm
廣告