基本蠟燭圖



以下是一個基本蠟燭圖案例。

我們在 Google Charts 配置語法 章節中已看到用於繪製圖表中的配置。現在,讓我們來看一個蠟燭圖案例。

配置

我們使用 **CandlestickChart** 類來展示一個基本的蠟燭圖。

type = 'CandlestickChart';

案例

app.component.ts

import { Component } from '@angular/core';
@Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.css']
})
export class AppComponent {
   title = '';
   type = 'CandlestickChart';
   data = [
      ["Mon", 20, 28, 38, 45],
      ["Tue", 31, 38, 55, 66],
      ["Wed", 50, 55, 77, 80],
      ["Thu", 77, 77, 66, 50],
      ["Fri", 68, 66, 22, 15]
   ];
   columnNames = ['Date', 'A','B','C','D'];
   options = { };
   width = 550;
   height = 400;
}

結果

驗證結果。

基本蠟燭圖 列印
angular_googlecharts_candlestick_charts.htm
廣告