【发布时间】:2019-03-11 12:36:56
【问题描述】:
我有一张如下图
<canvas
height="100"
width="100"
baseChart
[chartType]="'bar'"
[datasets]="chartData"
[colors]="colors"
[labels]="chartLabels"
[options]="chartOptions"
[legend]="true"
(chartClick)="onChartClick($event)">
</canvas>
并且像处理它一样
@ViewChild(BaseChartDirective)
public chart: BaseChartDirective;
这一切都很好。除了现在我需要在同一个 html 页面上添加一个新图表,但我不知道如何为另一个图表画布创建另一个句柄。 BaseChartDirective 似乎是通用的。它是如何连接到画布的?
【问题讨论】:
标签: ionic-framework ionic3 ng2-charts