Angular 在高度图表中以角度显示CSV数据
我想在Highcharts图表中显示csv文件中的数据 我找到了此链接并尝试使用其中描述的内容: 我的output-graph.component.ts代码现在如下所示:Angular 在高度图表中以角度显示CSV数据,angular,csv,highcharts,Angular,Csv,Highcharts,我想在Highcharts图表中显示csv文件中的数据 我找到了此链接并尝试使用其中描述的内容: 我的output-graph.component.ts代码现在如下所示: export class OutputGraphComponent implements OnInit { public options: any = { chart: { type: 'column' }, data: { csvURL: 'assets/test.csv'
export class OutputGraphComponent implements OnInit {
public options: any = {
chart: {
type: 'column'
},
data: {
csvURL: 'assets/test.csv'
},
title: {
text: window.location.origin
},
yAxis: {
title: {
text: 'Units'
}
}
}
constructor() { }
ngOnInit(){
Highcharts.chart('container', this.options);
}
}
Categories,Apples,Pears,Oranges,Bananas
John,8,4,6,5
Jane,3,4,2,3
Joe,86,76,79,77
Janet,3,16,13,15
我的csv如下所示:
export class OutputGraphComponent implements OnInit {
public options: any = {
chart: {
type: 'column'
},
data: {
csvURL: 'assets/test.csv'
},
title: {
text: window.location.origin
},
yAxis: {
title: {
text: 'Units'
}
}
}
constructor() { }
ngOnInit(){
Highcharts.chart('container', this.options);
}
}
Categories,Apples,Pears,Oranges,Bananas
John,8,4,6,5
Jane,3,4,2,3
Joe,86,76,79,77
Janet,3,16,13,15
然而,当我启动网站时,Highcharts图表上只有一个空白,上面写着“无数据显示”
我做错了什么?如何在具有角度的Highcharts中显示csv文件?您需要导入并初始化
数据
模块:
import * as Highcharts from 'highcharts';
import HC_data from 'highcharts/modules/data';
HC_data(Highcharts);
文档:Hi@J.Doe,您导入并初始化了
数据
模块了吗?我不这么认为,正确的导入方式是什么?