这里是一个有效的代码示例,我创建了一个图
import $ from 'jquery';
import Highcharts from 'highcharts';
class test {
constructor(){
let chart = new Highcharts.chart('container', {
chart: {
animation: false
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
}
}
现在我想做一个像https://jsfiddle.net/74vn5utd/的股票图表
但是我导入了它及其模块
import StockChart from 'highcharts/highstock';
import datahc from 'highcharts/modules/data';
加载模块之后
datahc(StockChart);
最后我将图表称为]
StockChart.chart('container', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
series: [{
name: 'AAPL',
data: response.graph,
tooltip: {
valueDecimals: 2
}
}]
});
预先感谢
这是一个有效的代码示例,我从'jquery'创建了一个图形导入$;从“ highcharts”中导入Highcharts;类测试{builder(){let chart = new Highcharts.chart('...
您仍然使用chart