您好我试图使用高级图表显示静态数据,我收到错误13,我放置了这个
<div id="container" style="display: block;" ></div>
在html文件中,下面是我用来显示图表的数据
import * as HighCharts from 'highcharts';
ionViewDidLoad(){
var myChart = HighCharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
}
是否有更好的离子图表库用于显示chart.js以外的图表
答案 0 :(得分:1)
有一个名为 angular2-highcharts
import { ChartModule } from 'angular2-highcharts';
和选项为,
class AppComponent {
constructor() {
this.options = {
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
};
}
options: Object;
}
答案 1 :(得分:1)