Bonjour,

J'ai un souci de mise en forme d'un graph fait avec HighCharts.

Voici le résultat :

Nom : chart.jpeg
Affichages : 378
Taille : 43,1 Ko

Voici mon code JS:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 
$(function () {
    var url =  link+"app/db/ref3x";
 
    $.ajax({
        url : url,
        type : 'GET',
        dataType : 'json', // On désire recevoir du HTML
        success : function(code_json){ // code_html contient le HTML renvoyé
            Highcharts.chart('ct_moy_pre_jo', {
                chart: {
                    renderTo: 'ct_moy_pre_jo',
                    type: 'column'
                },
                title: {
                    text: 'Moyenne de présence par jour '
                },
                tooltip: {
                    formatter: function () {
                        return '' +
                            "" +
                            'Time: ' + Highcharts.dateFormat('%H:%M:%S', this.y);
                    }
                },
                plotOptions: {
                    column: {
                        dataLabels: {
                            rotation: -55,
                            enabled: true,
                            formatter: function () {
                                if (this.y === 0) {
                                    return "";
                                }
                                else {
                                    return Highcharts.dateFormat('%H:%M:%S', this.y);
                                }
                            }
                        }
                    }
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: 'Moyenne (heure)',
                        align: 'high'
                    },
                    labels: {
                        overflow: 'justify',
                        formatter: function () {
                            var seconds = (this.value / 1000) | 0;
                            this.value -= seconds * 1000;
 
                            var minutes = (seconds / 60) | 0;
                            seconds -= minutes * 60;
 
                            var hours = (minutes / 60) | 0;
                            minutes -= hours * 60;
                            return hours;
                        }
                    }
                },
                dateFormat: { format: '%H:%M:%S' },
                xAxis: {
                    categories: code_json[0]
                },
                series: [{
                    name: 'Présence',
                    data: code_json[1]
                }]
            });
         }
    });
});
Et voici ce qui est reçu en json :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
[["2016-11-01","2016-11-02","2016-11-03","2016-11-08","2016-11-09","2016-11-10","2016-11-15","2016-11-16"
,"2016-11-17","2016-11-22","2016-11-23","2016-11-24"],[0,0,0,0,0,0,1480296600000,1480303010000,1480309955000
,0,0,0]]
Je ne comprend pas d'où proviens le problème, malgré les recherches sur les forums ou le site officiel d'HighCharts.

Merci d'avance pour votre aide précieuse.

Yasen