2
凡例の位置を変更するにはどうすればよいですか(デフォルトではグラフの上に表示されます)?私はng-charts
を使用しており、私はdocumentationに従って位置を変更しようとしていますが、動作していないようです。ng-chartsの凡例の位置を変更する(angular2を使用)
テンプレートは、この含まれています
<canvas baseChart
[datasets]="datasets"
[labels]="labels"
[chartType]="type"
[colors]="colors"
[legend]="legend"
[position]="position">
</canvas>
を、コンポーネント変数は以下のとおりです。
labels: string[] = [ 'EMI', 'Food', 'Fuel', 'bike' ];
type: string = 'doughnut';
legend: boolean = true;
position: string = 'left';
colors: Color[] = [{}];
datasets: any[] = [{
data: [ 3350, 5450, 4100, 1000 ],
backgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}];