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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
//Destruction des stores
stoGraphModulationUp.removeAll();
stoGraphModulationDown.removeAll();
//Affichage du mask
mask.show();
//on vérifie si les la ddl est valide
ddlBS.validate();
//Récupération des valeurs
var BS = Ext.getCmp('ddlBS').getValue();
var txtDateDebut = Ext.getCmp('txtDateDebut').getValue();
var txtDateFin = Ext.getCmp('txtDateFin').getValue();
//alert(graphCreer);
// Si on a une BS
if(ddlBS.isValid())
{
if(graphCreer == 1)
{
destroyUp();
destroyDown();
}
//On charge le graph UP
stoGraphModulationUp.load
({
//Passage des paramètres
params:{BS: BS,DateDeb: txtDateDebut,DateFin: txtDateFin},
callback:function(records)
{
//Récup du total du JSON
total = stoGraphModulationUp.reader.jsonData.total;
// Si on a des valeurs
if(total > 0)
{
//Un graphe a été créé
graphCreer = 1;
i=0;
//On boucle et on insère les données du JSON ds des arrays
for(var i=0; i<total; i++){
date[i] = records[i].data.DateInsert;
value64Qam34[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Mod64Qam34);
value64Qam23[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Mod64Qam23);
value16Qam34[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Mod16Qam34);
value16Qam12[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Mod16Qam12);
valueQpsk34[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Qpsk34);
valueQpsk12[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Qpsk12);
valueBpsk12[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Bpsk12);
valueError[i] = new Array(Date.UTC(records[i].data.Annee,records[i].data.Mois,records[i].data.Jour,records[i].data.Heure,records[i].data.Minute),records[i].data.Error);
}
//Création du graphe
$(document).ready(function() {
chartUp = new Highcharts.Chart({
chart: {
id:'chartUp',
zoomType: 'x',
renderTo: 'containerUp',
defaultSeriesType: 'area'
},
title: {
text: 'Modulation Uplink'
},
xAxis: {
type:'datetime',
dateTimeLabelFormats: { // don't display the dummy year
month: '%e. %b',
year: '%b'
},
//categories: date,
/* tickmarkPlacement: 'on',
*/labels: {
rotation: -90,
align: 'right'
},
title: {
enabled: false
}
},
yAxis: {
title: {
text: 'Nb Clients'
},
labels: {
formatter: function() {
return this.value ;
}
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
Highcharts.dateFormat('%e. %b %H:%M', this.x) +': '+ this.y +' Clients';
}
},
plotOptions: {
area: {
stacking: 'normal',
lineWidth: 1,
marker: {
enabled: false,
states: {
hover: {
enabled: true,
symbol: 'circle',
radius: 5,
lineWidth: 1
}
}
},
}
},
series: [{
name: '64Qam 3/4',
data: value64Qam34
}, {
name: '64Qam 2/3',
data: value64Qam23
}, {
name: '16Qam 3/4',
data: value16Qam34
}, {
name: '16Qam 1/2',
data: value16Qam12
}, {
name: 'Qpsk 3/4',
data: valueQpsk34
}, {
name: 'Qpsk 1/2',
data: valueQpsk12
}, {
name: 'Bpsk 1/2',
data: valueBpsk12
}, {
name: 'Error',
data: valueError
}]
});
});
// On cache le mask
mask.hide();
}
else
{
// On cache le mask
mask.hide();
alert('Aucune valeur pour la BS selectionn\351e');
//alert(graphCreer);
//Destruction du graphe Up
if(graphCreer == 1)
{
graphCreer = 0;
destroyUp();
}
}
}
});
/*FIN DU GRAPHE UP */ |
Partager