1
我試圖讓使用Hightcharts.js的圖形,但得到一個錯誤Highcharts.stockChart不是函數
TypeError: Highcharts.stockChart is not a function.
我使用NPM安裝它(的package.json)
"highcharts": "^5.0.6"
Сall
var Highcharts = require('highcharts');
並使用
var options = {
chart: {
alignTicks: false,
renderTo: 'container'
},
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Volume'
},
series: [{
type: 'column',
name: 'AAPL Stock Volume',
data: [],
dataGrouping: {
units: [[
'week', // unit name
[1] // allowed multiples
], [
'month',
[1, 2, 3, 4, 6]
]]
}
}];
};
var chart = Highcharts.stockChart(options);
Highstock不是一個單獨的模塊,屬於Highcharts,我不明白可能是什麼問題?
真棒,非常感謝你! – iGanza