带有负值的面积图



以下是有负值的面积图的示例。

我们已经了解了在谷歌图表配置语法章节中绘制图表所使用的配置。现在,我们来看看带负值的面积图的示例。

配置

我们已经使用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;
}

结果

验证结果。

Area Chart with negative values
angular_googlecharts_area_charts.htm
广告
© . All rights reserved.