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
|
var WLigneCSV = "TRANCHES HORAIRES;INTERVALES;NB DEPART;NB ARRIVEE;TOTAL" + "\n";
...
...
...
dataView: {
show: true, // Affiche ou non l'icône pour afficher les données utilisées.
readOnly: false,
backgroundColor: '#88ABD9',
title: 'Données',
lang: ['Données utilisées pour le graphique...', 'Retour', 'Export CSV'],
optionToContent: function(opt) {
if (P_Plateforme == "LFPO")
{
$('#Info_lfpo_hg').css('display','none'); // Effacement de la DIV Info_lfpo_hg
}
if (P_Plateforme == "LFPG")
{
$('#Info_lfpg_hg').css('display','none'); // Effacement de la DIV Info_lfpo_hg
}
if (P_Plateforme == "LFPB")
{
$('#Info_lfpb_hg').css('display','none'); // Effacement de la DIV Info_lfpo_hg
}
var axisData = opt.xAxis[0].data;
var series = opt.series;
var WTable01 = '<div id="ID_Table_Data">';
WTable01 = WTable01 + '<table class="table-fill">';
WTable01 = WTable01 + '<thead><tr>';
WTable01 = WTable01 + '<th class="text-center" style="width:120px">Tranches Horaires</th>'
WTable01 = WTable01 + '<th class="text-center" style="width:120px">Intervales</th>'
WTable01 = WTable01 + '<th class="text-center">' + series[1].name + '</th>';
WTable01 = WTable01 + '<th class="text-center">' + series[2].name + '</th>';
WTable01 = WTable01 + '<th class="text-center">' + series[0].name + '</th>';
WTable01 = WTable01 + '</tr></thead>';
WTable01 = WTable01 + '<tbody class="table-hover">';
for (var i = 0, l = axisData.length; i < l; i++) {
WLigneCSV = WLigneCSV + TranchesHoraires_X[i] + ";" + Interv[parseInt(i)] + ";"
WLigneCSV = WLigneCSV + series[1].data[i] + ";" + series[2].data[i] + ";" + series[0].data[i]
WLigneCSV = WLigneCSV + "\n";
WTable01 += '<tr>'
+ '<td class="text-center">' + TranchesHoraires_X[i] + '</td>'
+ '<td class="text-center">' + Interv[parseInt(i)] + '</td>'
+ '<td class="text-center">' + series[1].data[i] + '</td>'
+ '<td class="text-center">' + series[2].data[i] + '</td>'
+ '<td class="text-center">' + series[0].data[i] + '</td>'
+ '</tr>';
}
WTable01 += '</div></tbody></table>';
return WTable01;
},
contentToOption: function(){ // Va permetrtre de gérer l'exportation en CSV
var NomCSV = "HeuresGlissantes_" + P_dayInit;
var Ext = ".CSV";
var FicCSV = NomCSV + Ext;
// Ecrire le contenu de la variable WLigneCSV dans un fichier
download(FicCSV, WLigneCSV);
}
}
...
...
... |
Partager