如何解决Angular HighCharts更新系列
您好,我正在为我的应用程序使用highcharts-angular
。我有关于更新higchart系列的问题。它没有正确更新。我创建了DEMO,点击更新后您会看到问题。
在html部分中
<highcharts-chart [Highcharts]="Highcharts" [options]="chartOptions" [(update)]="updateFromInput" style="width: calc(100% ); height: calc(100% - 67px); display: block;margin-top:15px;overflow: auto !important;">
</highcharts-chart>
在组成部分
BarxFilter(model) {
var series=this.groupBy(model.BAR.DATA,'GRUP','bar');
console.log(series);
var categories=this.ArrNoDupe(model.BAR.DATA.map(x=>x.NAME))
this.chartOptions = {
chart: { backgroundColor: null,borderWidth: 0 },title: { text: '' },credits: { enabled: false },legend: { enabled: true },tooltip: { hideDelay: 0,outside: true,shared: true },xAxis: { categories: categories },yAxis:{title:{enabled:false} },plotOptions: { column: { negativeColor: '#910000',borderColor: 'gray' } },series: series
};
this.updateFromInput = true;
}
在系列数据更改后如何正确更新图表?
解决方法
在更新之前,您需要将oneToOne option设置为true:demo
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。