When i try to add this code snippet to my chart:
Code: Select all
data: {
firstRowAsNames: false,
columnsURL: data,
enablePolling: true
},
Code: Select all
Uncaught TypeError: h.data.slice is not a function
at highstock.src.js:56215
at Array.forEach (<anonymous>)
at f.updateNavigatorSeries (highstock.src.js:56179)
at f.init (highstock.src.js:55992)
at new f (highstock.src.js:55120)
at d.<anonymous> (highstock.src.js:56562)
at highstock.src.js:1657
at Array.forEach (<anonymous>)
at K (highstock.src.js:1654)
at d.f.firstRender (highstock.src.js:31954)
Code: Select all
data: data,
here's my full code:
Code: Select all
function leanChart() {
Highcharts.setOptions({
time: {
timezone: 'America/New_York'
}
});
Highcharts.getJSON('/api/certainstocks', function (data) {
Highcharts.stockChart('container', {
rangeSelector: {
enabled: false,
},
title: {
text: 'Index stocks'
},
chart: {
spacingRight: "10"
},
series: [{
name: 'Stocks',
data: {
firstRowAsNames: false,
columnsURL: data,
enablePolling: true
},
tooltip: {
valueDecimals: 2
},
threshold: 0,
negativeColor: '#ff6161',
color: '#2f95fa',
}],
});
});
}