here are an example of code that work, I create a graph
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]
}]
});
}
}
now I want do a stockChart like https://jsfiddle.net/74vn5utd/
but I import it and its module
import StockChart from 'highcharts/highstock';
import datahc from 'highcharts/modules/data';
after that I load the module
datahc(StockChart);
and finally I call the chart and
StockChart.chart('container', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
series: [{
name: 'AAPL',
data: response.graph,
tooltip: {
valueDecimals: 2
}
}]
});
I have a regular graph, not a HighStock graph, I don't get it, what is wrong?
thanks in advance