Angular-googlecharts-sankey-customized

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

カスタマイズされたサンキーチャート

以下は、カスタマイズされたSanKeyチャートの例です。

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

構成

*Sankey* オプションを使用して、Sankeyチャートをカスタマイズしました。
options = {
   sankey: {
      link:{
         color:{
            stroke:'black',
            strokeWidth:1
         }
      }
   }
};

*_app.component.ts_*
import { Component } from '@angular/core';
@Component({
   selector: 'app-root',
   templateUrl: './app.componentl',
   styleUrls: ['./app.component.css']
})
export class AppComponent {
   title = '';
   type = 'Sankey';
   data = [
      ["Brazil","Portugal",5],
      ["Brazil","France",1],
      ["Brazil","Spain",1],
      ["Brazil","England",1],
      ["Canada","Portugal",1],
      ["Canada","France",5],
      ["Canada","England",1],
      ["Mexico","Portugal",1],
      ["Mexico","France",1],
      ["Mexico","Spain",5],
      ["Mexico","England",1],
      ["USA","Portugal",1],
      ["USA","France",1],
      ["USA","Spain",1],
      ["USA","England",5]
   ];
   columnNames = ['From', 'To','Weight'];
   options = {
      sankey: {
         link:{
            color:{
               stroke:'black',
               strokeWidth:1
            }
         }
      }
   };
   width = 550;
   height = 400;
}

結果

結果を確認します。

カスタマイズされたサンキーチャート