bah les mois de l'année je les ai mis en dur ^^
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'combot_intext'
},
title: {
text: 'Internal / External',
},
subtitle: {
text: save_country + " : " + selected_year,
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Population'
}},
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y;
} else {
s = ''+
this.x +': '+ this.y;
}
return s;
}
},
labels: {
items: [{
html: 'Total',
style: {
left: '40px',
top: '8px',
color: 'black'
}
}]
},
series: [{
type: 'column',
name: 'Internal',
data: [ tab_internal[1], tab_internal[2], tab_internal[3], tab_internal[4],tab_internal[5],tab_internal[6],tab_internal[7],tab_internal[8],tab_internal[9],tab_internal[10],tab_internal[11],tab_internal[12]]
}, {
type: 'column',
name: 'External',
data: [tab_external[1],tab_external[2],tab_external[3],tab_external[4],tab_external[5],tab_external[6],tab_external[7],tab_external[8],tab_external[9],tab_external[10],tab_external[11],tab_external[12] ]
}, {
type: 'spline',
name: 'Average',
data: [ ]
}, {
type: 'pie',
name: 'Total consumption',
data: [{
name: 'Internal',
y: data_intext[0],
color: '#4572A7'
}, {
name: 'External',
y: data_intext[1],
color: '#AA4643'
}],
center: [100, 80],
size: 100,
showInLegend: false,
dataLabels: {
enabled: false
}
}]
});
});
aurais tu une idée de comment je pourrai ancrer un for ici alors ?
truc du genre je pense ...
data: [ for (var i = 1;i<13;i++) {tab_internal
,}]
mais comment je fais pour la virgule^^