【发布时间】:2019-09-03 08:45:37
【问题描述】:
因此,我使用 Angular 将 CSV 加载到 Hicharts 中的常规方法如下:
export class OutputGraphComponent implements OnInit {
public options: any = {
chart: {
type: 'column'
},
data: {
csvURL: path.to.file
},
title: {
text: window.location.origin
},
yAxis: {
title: {
text: 'Units'
}
}
}
constructor() { }
ngOnInit(){
Highcharts.chart('container', this.options);
}
}
现在,我想做的是选择一个文件,例如像这样的 html 表单,然后在图表中使用它。
<div class="form-group">
<label for="file">Choose File</label>
<input type="file"
id="file"
(change)="handleFileInput($event.target.files)">
</div>
是否有可能在不重新加载网站的情况下执行此操作?如果没有,我还能如何选择要在 Web 应用程序上加载到 Highcharts 中的文件?
【问题讨论】:
标签: angular highcharts