迭代 Angular 中的项目时与 syncfusion 图表的行为不一致
inconsistent behaviour with syncfusion charts while iterating over the items in Angular
我在我的应用程序中使用 Syncfusion 图表。
我在下面的 stackblitz link.
中实现了一个示例
https://stackblitz.com/edit/angular-ng8kss?file=src%2Fapp%2Fapp.component.html
如果我打印一次图表,它工作正常
问题:遍历项目时图表未显示为 tempArray 中的项目数(请参阅 app.component.html 中的第一行代码)
如果有人知道答案,请告诉我。
我们可以通过parent id in chart print方法来达到你的要求,这样就可以像你一样打印出整个图表想要。
print.html
<div class="col-md-9" id="print1">
<div *ngFor="let item of tempArray;let i = index">
// Other chart configurations
</div>
</div>
print.component.ts
// Getting instance of chart
@ViewChild('pie')
public pie: AccumulationChartComponent;
public mode(e: Event): void {
// Passing the parent id
this.pie.print("print1");
}
希望这对您有所帮助。
谢谢,
陀罗尼.
我在我的应用程序中使用 Syncfusion 图表。 我在下面的 stackblitz link.
中实现了一个示例https://stackblitz.com/edit/angular-ng8kss?file=src%2Fapp%2Fapp.component.html
如果我打印一次图表,它工作正常
问题:遍历项目时图表未显示为 tempArray 中的项目数(请参阅 app.component.html 中的第一行代码) 如果有人知道答案,请告诉我。
我们可以通过parent id in chart print方法来达到你的要求,这样就可以像你一样打印出整个图表想要。
print.html
<div class="col-md-9" id="print1">
<div *ngFor="let item of tempArray;let i = index">
// Other chart configurations
</div>
</div>
print.component.ts
// Getting instance of chart
@ViewChild('pie')
public pie: AccumulationChartComponent;
public mode(e: Event): void {
// Passing the parent id
this.pie.print("print1");
}
希望这对您有所帮助。
谢谢, 陀罗尼.