I would to show my line chart into my html page but the filter date is always disabled and i haven't the data in xAxis, i don't know the cause of this kind of the problem ? Any help please ?
my code is :
function buildNumberElem(tabIn) {
var tabOut = [];
var data = [];
console.log(tabIn);
for (i in tabIn) {
var daTmp = tabIn[i].split("/");
var da = Date.UTC(parseInt(daTmp[2]), parseInt(daTmp[1]), parseInt(daTmp[0]));
if (tabOut[da]) {
tabOut[da] = tabOut[da] + 1;
} else {
tabOut[da] = +1;
}
}
for(i in tabOut){
var dataX = [i,tabOut[i]];
data.push(dataX);
}
return data;
}
// lineData
var lineData = [{
name: 'RC',
data: buildNumberElem(rc)
},{
name: 'DAB',
data: buildNumberElem(dab)
}];
renderSinistersLineChart('line', lineData);
$('#lineChart').highcharts('StockChart', {
chart: {
renderTo: 'container',
type: 'line'
},
scrollbar: {
enabled: false
},
navigator: {
enabled: true
},
rangeSelector : {
allButtonsEnabled: true,
buttons: [{
type: 'month',
count: 3,
text: 'Jours',
dataGrouping: {
forced: true,
units: [['day', [1]]]
}
},{
type: 'all',
text: 'Mois',
dataGrouping: {
forced: true,
units: [['month', [1]]]
}
}],
buttonTheme: {
width: 60
},
selected: 2
},
title: {
text: 'Déclarations de Sinistres',
x: -20 //center
},
subtitle: {
text: 'du 01/01/'+ year +' au '+ today,
x: -20
},
tooltip: {
valueSuffix: ' sinistres',
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'bottom',
borderWidth: 0
},
// Dynamic DATA
series: linedata
,
credits: {
enabled: false
},
exporting: {
buttons: {
contextButton: {
text: 'Imprimer'
}
},
printButton: {
enabled: true
}
}
});