Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > jQuery
jQuery Forum d'entraide sur le framework jQuery. Avant de poster : Tutoriels jQuery, FAQ jQuery, Tous les tutoriels JavaScript, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/04/2011, 15h35   #1
Futur Membre du Club
 
Inscription : mars 2010
Messages : 105
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 105
Points : 18
Points : 18
Par défaut Graphique / donnée gardée en mémoire

Bonjour à tous,

j'utilise Highcharts, une librairie pour dessiner des graphiques.
Les informations que j'utilise pour mes graphiques viennent de store rempli via une table mssql par JSON.

Mon souci est le suivant:

Lorsque j'affiche mes graphes, il m'arrive aléatoirement, que des données des graphs précédent se glisse dans mon graphique suivant.

En vérifiant via firebug le contenu de mon nouveau JSON, il n'y a rien d'incohérent.

Dans sa librairie, highcharts possède une méthode destroy, qui permet de purger les graphiques et la mémoire.
http://www.highcharts.com/ref/#chart-object

Rien n'y fait malheureusement.
Quelqu'un aurait-il une idée d'où pourrait venir mon effet de donnée en mémoire?
Je peux poster mon code, mais la page est assez conséquente.

En espérant une réponse,

Cordialement
Nheil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2011, 16h12   #2
Futur Membre du Club
 
Inscription : mars 2010
Messages : 105
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 105
Points : 18
Points : 18
Je rajoute un point important, lorsque je rafraichi ma page, le problème disparait, et réapparait au bout de quelques graphiques.
Nheil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2011, 18h38   #3
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 933
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 933
Points : 4 756
Points : 4 756
Bonjour,
difficile à dire, mais sans mettre le code si tu avais un lien sur une page...
N'y aurait-il pas un problème de cache ?
As tu essayé sur différents navigateurs ?
...
NoSmoking est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/05/2011, 09h18   #4
Futur Membre du Club
 
Inscription : mars 2010
Messages : 105
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 105
Points : 18
Points : 18
Nan, je développe en local actuellement.

Concernant mon problème de cache. Que pourrais-je faire/regarder pour voir si le problème ne viendrait pas de là.
Je vais reprendre mon code de mon coté et voir si je n'ai pas un souci.
Nheil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/05/2011, 11h45   #5
Futur Membre du Club
 
Inscription : mars 2010
Messages : 105
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 105
Points : 18
Points : 18
Je ne m'en sors pas, voila la fonction qui dessine le graphe UP

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
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 */
Nheil est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 09h21.


 
 
 
 
Partenaires

Hébergement Web