Angular-googlecharts-candlestick-customized

提供:Dev Guides
移動先:案内検索

カスタマイズされた色のCandleStickチャート

以下は、CandleStickチャートの例です。

link:/angular_googlecharts/angular_googlecharts_configuration_syntax [Googleグラフの構成構文]の章で、グラフを描画するために使用される構成を既に確認しました。 次に、CandleStickチャートの例を見てみましょう。

構成

CandleStick Chartのカスタマイズされた色に*オプション*を使用しました。

options = {
   legend:'none',
   candlestick: {
      fallingColor: { strokeWidth: 2, stroke:'#a52714' },//red
      risingColor: { strokeWidth: 2, stroke: '#0f9d58' }  //green
   }
};

*_app.component.ts_*
import { Component } from '@angular/core';
@Component({
   selector: 'app-root',
   templateUrl: './app.componentl',
   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 = {
      legend:'none',
      candlestick: {
         fallingColor: { strokeWidth: 2, stroke:'#a52714' },//red
         risingColor: { strokeWidth: 2, stroke: '#0f9d58' }  //green
      }
   };
   width = 550;
   height = 400;
}

結果

結果を確認します。

カスタマイズされた色のCandleStickチャート