堆疊階梯圖



以下是一個堆疊階梯圖示例。

我們已經在 Google Charts 配置語法 章節中看到了用於繪製圖表的配置。現在,讓我們看一個堆疊階梯圖示例。

配置

我們已經使用 isStacked 配置將階梯圖顯示為堆疊圖。

options = { 
   isStacked:true	 
};

示例

app.component.ts

import { Component } from '@angular/core';
@Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.css']
})
export class AppComponent {
   title = "'The decline of 'The 39 Steps'";
   type = 'SteppedAreaChart';
   data = [
      ["Alfred Hitchcock (1935)", 8.4, 7.9],
      ["Ralph Thomas (1959)",     6.9,         6.5],
      ["Don Sharp (1978)",        6.5,         6.4],
      ["James Hawes (2008)",      4.4,         6.2]
   ];
   columnNames = ['Director (Year)', 'Rotten Tomatoes','IMDB'];
   options = { 
      vAxis:{
         title:'Accumulated Rating'
      },
      isStacked:true	 
   };
   width = 550;
   height = 400;
}

結果

驗證結果。

Stacked Stepped Chart
angular_googlecharts_stepped_charts.htm
廣告