javascript - 我的刷新适用于图形但不适用于桌面
问题描述
我有一张带桌子的图形
我的问题是图形刷新而不是表格,我必须按 F5 并刷新表格。
我希望表格与图表同时更新。
<div class="row">
<div class="col-12 col-md-6">
<div id="chartdivpricing" style="width: 100%;height: 400px; position: relative; top: -23px;">
</div>
</div>
<div class="col-12 col-md-6">
<div class="table-responsive">
<table class="table table-striped" *ngIf="lastprice.length > 0">
<tr style="background-color: #f8f9fa;">
<td style="width: 30%;">
<span>Time transaction</span>
</td>
<td style="width: 30%;" class="text-right">
<span>Trading quantity</span>
</td>
<td style="width: 40%;">
<span>Price</span>
</td>
</tr>
<tr *ngFor="let lp of lastprice">
<td style="border: 0px;">
<span>
{{lp.TIME | getXFirstElements:'8' }}
</span>
</td>
<td style="border: 0px;" class="text-right">
<span>
{{lp.VOLUMEJOUR | myformatnum }}
</span>
</td>
<td style="border: 0px;">
<span>
{{lp.COURS | number:'1.6-6' | myformatnum }}
</span>
</td>
</tr>
</table>
</div>
</div>
</div>
图形在这里
<div id="chartdivpricing" style="width: 100%;height: 400px; position: relative; top: -23px;"></div>
我不知道我应该如何修复表格中的刷新,就像图表一样?
prepareDataForHistory(res) {
if (res.RETURNCODE == 'OKK00') {
this.amChartsHistoryData = []
for (var j = 0; j < res.HISTO.POINT.length; j++) {
if (this.amChartsHistoryDataIntraday) {
this.amChartsHistoryData.push({
"date": new Date(res.HISTO.POINT[j].DATE + " " + res.HISTO.POINT[j].TIME),
"price": res.HISTO.POINT[j].PRICE
});
} else {
this.amChartsHistoryData.push({
"date": new Date(res.HISTO.POINT[j].DATE.substr(0, 4), res.HISTO.POINT[j].DATE.substr(4, 2), res.HISTO.POINT[j].DATE.substr(6, 2)),
"price": res.HISTO.POINT[j].PRICE
});
}
}
this.designPricingAmcharts("chartdivpricing", "", this.amChartsHistoryData);
}
}
如果不是这个,我可以提供其他代码。
预先感谢您的帮助。
解决方案
您的表格取决于“lastprice”。所以除非'lastprice'改变,否则它不会改变。
推荐阅读
- templates - 使用模板重载转换运算符
- perl - 如何在 Perl 中检查回文?
- sql - SQL Server:group by 以检索 0 的行
- linux - 找到新安装的应用程序“Beyond Compare”的可执行文件
- vue-component - Rails 5.1 API CORS 问题
- python - 数据框中的唯一值计数
- javascript - 反应本地存储
- json - 在 Spark 中展开 JSON 数组
- php - 总结具有多个索引的mysql json对象
- amazon-web-services - 使用 Elastic Beanstalk 应用程序启用 HTTPS 和 HTTP