Modifier format affichage date d'un axe (graph highcharts)
Bonjour à tous,
J'ai un graphique affichant une courbe de températures sur une année. Les jours (abscisse) sont affichés de 1 à 365 mais je dois afficher sur l'axe x du graph en jours calendaires genre "1 mars 2013".
Code:
1 2 3 4 5
| var listeJour = new Array(365); // je veux que le graph affiche cela en format "JJ-MM-AAAA"
for(x=1;x <= listeJour.length;x++){
listeJour[x-1]=x;
}
var listeValeur= courbeTemp(listeJour, parametresCourbe); |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| function (listeJour,listeValeur,titre) {
$('#graph_GAI_div').highcharts({
title: {
text: titre
},
xAxis: {
categories: listeJour,
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function () {
return this.value + '';
}
}
},
plotOptions: {
marker: {
radius: 2,
lineColor: '#666666',
lineWidth: 0.5
}
},
tooltip: {
crosshairs: {
color: 'red',
dashStyle: 'solid'
},
shared:false
},
series: [{
name: 'temp',
lineColor: 'green',
marker: {
symbol: 'diamond'
},
data: listeValeur
}]
});
} |
J'ai décidé d'intégrer
Code:
1 2 3 4 5
| labels: {
formatter: function () {
return listeJour(this.value).format("JJ-MM-AAAA");
}
} |
dans XAxis mais cela ne fonctionne toujours pas. Comment faire. Ai-je oublié une variable de transformation?