【发布时间】:2017-02-21 20:31:18
【问题描述】:
我有一个通过 api 检索的 json,如下所示,
http://www.jsoneditoronline.org/?id=3d6078cbb11e7e5b3989320ff1cc00c1
我正在遍历结果集并创建一个票证对象,如下所示,
data.ticket.seating.forEach((seat: any) => {
this.listings.push({ section: seat.section, selling: data.price.selling, amount: data.ticket.amount, type: data.ticket.type, row: seat.row });
this.barChartLabels.push(data.price.selling);
this.barChartData[0].data.push() // how to push the count of tickets which has the same price.
});
在上面的代码中,如何获取相同价格的门票数量?另外如何获得所有门票中的最高价格?
【问题讨论】:
-
仅供理解:您想按价格对门票进行分组吗?
-
@floriangosse 是按价格分组门票
标签: javascript angular typescript