Blame view

js/app/views/VisuUI.js 14.7 KB
5cfea1f2   elena   vizu draft
1
2
3
4
5
6
/**
 * Project       AMDA-NG
 * Name          VisuUI.js
 * @class 	   amdaUI.visuUI
 * @extends      Ext.container.Container
 * @brief	   Visualization Module UI definition (View)
9d412dda   elena   catalog tmp and r...
7
 * @author 	  elena
5cfea1f2   elena   vizu draft
8
9
10
11
 */

Ext.define('amdaUI.VisuUI', {
	extend: 'Ext.container.Container',
9d412dda   elena   catalog tmp and r...
12
13
	alias: 'widget.panelVisu', 
	
e1fd05b4   Elena.Budnik   visu from cacheCat
14
	constructor: function(config) {
5cfea1f2   elena   vizu draft
15
		this.init(config);
9d412dda   elena   catalog tmp and r...
16
17
		this.callParent(arguments);	
		if (this.object) this.reformObject();
5cfea1f2   elena   vizu draft
18
19
	},
	
e1fd05b4   Elena.Budnik   visu from cacheCat
20
	setObject : function (obj) {		
9d412dda   elena   catalog tmp and r...
21
22
23
24
		this.object = obj;
		this.reformObject();
	},
	
e1fd05b4   Elena.Budnik   visu from cacheCat
25
	updateObject : function () {	
9d412dda   elena   catalog tmp and r...
26
27
28
		 return true;
	},
	
e1fd05b4   Elena.Budnik   visu from cacheCat
29
	reformObject : function () {
9d412dda   elena   catalog tmp and r...
30
31
32
		this.fromPlugin = this.object.get('fromPlugin');	
		
		if (this.fromPlugin) {
e1fd05b4   Elena.Budnik   visu from cacheCat
33
34
35
36
37
			if (this.object.get('folderId') == '')
				this.object.set('id','cacheCat');
			else
				this.object.set('id',this.object.get('folderId'));
			
9d412dda   elena   catalog tmp and r...
38
39
40
41
42
43
			this.object.set('objName',this.object.get('objName'));
		}
		else {
			this.object.set('id',this.object.get('id'));
			this.object.set('name',this.object.get('name'));
		}
5cfea1f2   elena   vizu draft
44
		// load object into view
e1fd05b4   Elena.Budnik   visu from cacheCat
45
		if (this.object.get('id') != '')
f8448f55   elena   tooltip
46
				this.loadObject();
5cfea1f2   elena   vizu draft
47
	},
9d412dda   elena   catalog tmp and r...
48
		 	
fded4fcb   elena   reload corrected
49
	reset : function() {
ccb80610   elena   added options
50
51
52
53
54
55
56
57
		//reset all fieldsets except the first one (name, intervals)
		var form = this.items.items[0].items.items[0];
		for (var i = 1;  i < 4; i++) {
			var fieldset = form.items.items[i];
			Ext.each(fieldset.query('field'), function(field) {
				field.reset();
			});
		}
e1fd05b4   Elena.Budnik   visu from cacheCat
58
		this.resetChart();                    
fded4fcb   elena   reload corrected
59
	},
e1fd05b4   Elena.Budnik   visu from cacheCat
60
	
5cfea1f2   elena   vizu draft
61
62
63
64
	/**
	 * load object catalog into this view
	 */
	loadObject : function()
e1fd05b4   Elena.Budnik   visu from cacheCat
65
	{     
5cfea1f2   elena   vizu draft
66
67
68
		var me = this;
		
		var onAfterInit = function(result, e) 
e1fd05b4   Elena.Budnik   visu from cacheCat
69
70
71
72
73
74
75
76
		{
			if (!result) {			
				myDesktopApp.errorMsg(e.message);
				Ext.defer(function(){Ext.Msg.toFront()},10);
				
				return;
			}
			else if (!result.success)
5cfea1f2   elena   vizu draft
77
78
79
80
81
			{
				if (result.message)
					myDesktopApp.errorMsg(result.message);
				else
					myDesktopApp.errorMsg('Unknown error during catalog cache initialisation');
e1fd05b4   Elena.Budnik   visu from cacheCat
82
83
84

				Ext.defer(function(){Ext.Msg.toFront()},10);
				
5cfea1f2   elena   vizu draft
85
86
				return;
			}
e1fd05b4   Elena.Budnik   visu from cacheCat
87
			
5cfea1f2   elena   vizu draft
88
			var fields = [], i = 0, index;
e1fd05b4   Elena.Budnik   visu from cacheCat
89
90
91
92

			if (!result.cache) {
				me.object.set('name', result.name);
				me.object.set('nbIntervals', result.totalCount);
95dbfcfd   elena   save chart
93
				
e1fd05b4   Elena.Budnik   visu from cacheCat
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
				var params = [];
				Ext.Array.each(result.parameters, function(item, index) {
					params[index] = item;	     	  
				}, this);
		
				me.object.set('parameters', params);	  	
			}
			else {
				fields[0] = Ext.create('Ext.data.Field', { name : 'start', id: 'start', text : 'start: date' });
				fields[1] = Ext.create('Ext.data.Field', { name : 'stop',  id: 'stop',  text : 'stop: date' });
				i = 2;
			} 
			
			Ext.Array.each(me.object.get('parameters'), function(obj) {
				index = 'param'+i.toString();
7d14e196   Elena.Budnik   type definition f...
109
110
111
				if (obj.type == 2) {
					fields[i] = Ext.create('Ext.data.Field', { name : index, id: index, text : obj.name + ': string' });
					 
e1fd05b4   Elena.Budnik   visu from cacheCat
112
113
114
115
116
				}
				else if (obj.type == 1){
					fields[i] = Ext.create('Ext.data.Field', { name : index, id: index, text : obj.name + ': date' });
				}
				else {
7d14e196   Elena.Budnik   type definition f...
117
118
119
120
121
					fields[i] = Ext.create('Ext.data.Field', { name : index, id: index, text : obj.name,
						convert: function(value, record) {						
							return parseFloat(value);
						}
					});
5cfea1f2   elena   vizu draft
122
				}
5cfea1f2   elena   vizu draft
123
124
				i++;
			});
e1fd05b4   Elena.Budnik   visu from cacheCat
125
			
fded4fcb   elena   reload corrected
126
127
128
129
130
			if (me.chartStore) {				 
				me.parList.removeAll();
				me.reset();
				me.chartStore = null;
			}
5cfea1f2   elena   vizu draft
131
			
e1fd05b4   Elena.Budnik   visu from cacheCat
132
			me.parList.add(fields);
5cfea1f2   elena   vizu draft
133
134
			
			me.chartStore = Ext.create('Ext.data.Store', {
fded4fcb   elena   reload corrected
135
136
				fields : fields,				
		//		autoDestroy: false,
e1fd05b4   Elena.Budnik   visu from cacheCat
137
138
139
140
		//		pageSize : 200,
		//		buffered : true, 
		//		purgePageCount: 0,
		//		remoteSort: true,
5cfea1f2   elena   vizu draft
141
142
143
144
145
				autoload: false,
				proxy: {
					type: 'direct',
					api :
					{
86263051   elena   visu second draft
146
						read   :  AmdaAction.readIntervalsForChart
5cfea1f2   elena   vizu draft
147
148
					},
					// remplir automatiquement tt, sharedtt , catalog, shared catalog
9d412dda   elena   catalog tmp and r...
149
150
					extraParams : {'typeTT' : 'catalog', 'id' : me.object.get('id'), 
						         'name' : me.object.get('objName'), 'fromPlugin' : me.fromPlugin},
5cfea1f2   elena   vizu draft
151
152
153
154
155
156
157
158
159
160
161
					reader:
					{
						type: 'json',
						root: 'intervals',
						totalProperty : 'totalCount'
					}
				},
				listeners: {
					scope : me,
					load: function(store,records) {        
						//TODO enable plot button
9d412dda   elena   catalog tmp and r...
162
163
						// me.object.set('nbIntervals',me.chartStore.getTotalCount());

fded4fcb   elena   reload corrected
164
165
166
						// load object into form
						var formPanel =  me.items.items[0].items.items[0];
						formPanel.getForm().loadRecord(me.object);
5cfea1f2   elena   vizu draft
167
168
169
					}
				}
			});
56ad05d0   elena   lightware chart
170
171
			
			me.chartStore.load();			 
5cfea1f2   elena   vizu draft
172
		}
e1fd05b4   Elena.Budnik   visu from cacheCat
173
174

		AmdaAction.initForChart(this.object.get('id'), this.object.get('objName'), this.fromPlugin, 'catalog', onAfterInit);	
5cfea1f2   elena   vizu draft
175
176
	},
	
5cfea1f2   elena   vizu draft
177
178
179
180
181
182
	
	/**
	 * Check if changes were made before closing window 
	 * @return true if changes
	 */	
	fclose : function() 
e1fd05b4   Elena.Budnik   visu from cacheCat
183
184
	{  
		return false;
fded4fcb   elena   reload corrected
185
186
187
188
	},

	resetChart : function () {
		
ccb80610   elena   added options
189
190
191
192
		var emptyAxesConfig =   [{
			type: 'Numeric',
			position: 'bottom',
			fields: [],
a442d142   Elena.Budnik   redmine #5382
193
			title: 'X axis',
ccb80610   elena   added options
194
			grid : true
e1fd05b4   Elena.Budnik   visu from cacheCat
195
		}, {
ccb80610   elena   added options
196
197
198
			type: 'Numeric',
			position: 'left',
			fields: [],
a442d142   Elena.Budnik   redmine #5382
199
			title: 'Y axis',
ccb80610   elena   added options
200
201
202
			grid: true
		}];
		
fded4fcb   elena   reload corrected
203
204
		this.chartConfig.series[0].xField = '';
		this.chartConfig.series[0].yField = '';
fded4fcb   elena   reload corrected
205
		
ccb80610   elena   added options
206
207
208
209
		this.chartConfig.theme = 'Blue';
		
		this.chartConfig.axes = emptyAxesConfig; 
		 
fded4fcb   elena   reload corrected
210
211
212
213
		var chart =  Ext.create('Ext.chart.Chart', this.chartConfig);		
		this.replaceChart(chart);
										 
	},
5cfea1f2   elena   vizu draft
214
215
216
	
	plotChart : function () {
		
ccb80610   elena   added options
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
		this.chartConfig.store = this.chartStore;	
		
		var xTitle = this.items.items[0].items.items[0].items.items[1].items.items[2].getValue(); 
		var yTitle = this.items.items[0].items.items[0].items.items[2].items.items[2].getValue(); 
		
		if (xTitle) this.chartConfig.axes[0].title = xTitle;
		if (xTitle) this.chartConfig.axes[1].title = yTitle;
	    
		// axis modifs
		if (this.comboXrange.getValue() == 'manual') {
			var minX = this.comboXrange.next().next().getValue();			
			var maxX = this.comboXrange.next().next().next().next().getValue();
			this.chartConfig.axes[0].minimum = minX;
			this.chartConfig.axes[0].maximum = maxX ;
		} else {
			// unset min/max in config
			delete this.chartConfig.axes[0].minimum;
			delete this.chartConfig.axes[0].maximum;
		}
		if (this.comboYrange.getValue() == 'manual') {
			var minX = this.comboYrange.next().next().getValue();
			var maxX = this.comboYrange.next().next().next().next().getValue();
		//	if (minX && maxX) {
			this.chartConfig.axes[1].minimum = minX;
			this.chartConfig.axes[1].maximum = maxX;
		//	}						
		} else {
			// unset min/max in config
			delete this.chartConfig.axes[1].minimum;
			delete this.chartConfig.axes[1].maximum;
		}
		
		var chart =  Ext.create('Ext.chart.Chart', this.chartConfig);	
					 
e1fd05b4   Elena.Budnik   visu from cacheCat
251
		this.replaceChart(chart); 
fded4fcb   elena   reload corrected
252
	},
e1fd05b4   Elena.Budnik   visu from cacheCat
253
254
	   
	replaceChart: function(chart) {	
5cfea1f2   elena   vizu draft
255
256
257
258
		var chartPanel =  this.items.items[0].items.items[1];
		var oldChart = chartPanel.down('chart');
		oldIndex = chartPanel.items.indexOf(oldChart);
		chartPanel.remove(oldChart);
fded4fcb   elena   reload corrected
259
		chartPanel.insert(oldIndex, chart);	
5cfea1f2   elena   vizu draft
260
261
262
263
264
265
266
267
268
	},
	
	init : function (config) 
	{	 
		var store = Ext.create('Ext.data.Store', {
			fields      :  [],			
			autoload    : false
		});
		
ccb80610   elena   added options
269
270
271
272
273
		var rangeStore = Ext.create('Ext.data.Store', {
			fields      :  [],			
			autoload    : false
		});
		
5cfea1f2   elena   vizu draft
274
275
276
		this.chartConfig = {			
			width: 500,
			height: 500,
56ad05d0   elena   lightware chart
277
278
279
			animate: false,
			mask: false,
			shadow: false,
ccb80610   elena   added options
280
			theme:'Blue',
790fbd62   Elena.Budnik   local drawEngineI...
281
			background: { fill : "#fff" },
5cfea1f2   elena   vizu draft
282
			store: store,
ccb80610   elena   added options
283
			axes:   [{
5cfea1f2   elena   vizu draft
284
285
286
				type: 'Numeric',
				position: 'bottom',
				fields: [],
a442d142   Elena.Budnik   redmine #5382
287
				title: 'X axis',
5cfea1f2   elena   vizu draft
288
				grid : true
e1fd05b4   Elena.Budnik   visu from cacheCat
289
			}, {
5cfea1f2   elena   vizu draft
290
291
292
				type: 'Numeric',
				position: 'left',
				fields: [],
a442d142   Elena.Budnik   redmine #5382
293
				title: 'Y axis',
5cfea1f2   elena   vizu draft
294
295
296
297
				grid: true
			}],
			series: [{
				type: 'scatter',
ccb80610   elena   added options
298
299
				showMarkers: true,
				highlight: true,
56ad05d0   elena   lightware chart
300
// 		 		markerConfig: {
f8448f55   elena   tooltip
301
 //		 			radius: 5,
56ad05d0   elena   lightware chart
302
303
// 		 			size: 5
// 				},
5cfea1f2   elena   vizu draft
304
305
306
		// 		//      axes: ['left', 'bottom'],
				xField: '',
				yField: '',
ccb80610   elena   added options
307
308
309
310
311
312
// 				label: {
// //   					display: 'under',
// //   					renderer: function(value, label, storeItem, item, i, display, animate, index) {
// //   						return storeItem.param3;
// //   					}
// 				},
e1fd05b4   Elena.Budnik   visu from cacheCat
313
				tips: {
f8448f55   elena   tooltip
314
315
316
317
//					trackMouse: true,
					width: 10,
					height: 20,
					hideDelay: 100, //200 ms
ccb80610   elena   added options
318
					mouseOffset: [0,0],   //[15,18]
f8448f55   elena   tooltip
319
					renderer: function(storeItem, item) {						
ccb80610   elena   added options
320
						this.setTitle(storeItem.index + 1);
f8448f55   elena   tooltip
321
					}
e1fd05b4   Elena.Budnik   visu from cacheCat
322
323
				}
			}]
5cfea1f2   elena   vizu draft
324
		}
f965628c   elena   plottype
325
		
fded4fcb   elena   reload corrected
326
327
328
329
		this.parList  = Ext.create('Ext.data.Store', {
				fields : [ 'text', 'id']	
			});
		
5cfea1f2   elena   vizu draft
330
331
332
333
334
		var chart = Ext.create('Ext.chart.Chart', this.chartConfig);				
 
		this.parCombo = Ext.create('Ext.form.ComboBox', {
			emptyText: 'select parameter',
			editable: false,
fded4fcb   elena   reload corrected
335
			store: this.parList,
5cfea1f2   elena   vizu draft
336
337
			queryMode: 'local',
			displayField: 'text',
95dbfcfd   elena   save chart
338
			valueField: 'id',
7d14e196   Elena.Budnik   type definition f...
339
			// tpl:'<tpl for="."><div ext:qtip="{qtip}" class="x-combo-list-item">{Name}</div></tpl>', 
95dbfcfd   elena   save chart
340
341
342
			listeners : {
				scope : this,
				change : function(combo, newValue, oldValue) {
fded4fcb   elena   reload corrected
343
344
345
346
347
348
349
					if (newValue) {
						this.chartConfig.axes[0].fields = [newValue];
						var rec = combo.findRecordByValue(newValue);
						
						this.chartConfig.axes[0].title = rec.get('text'); 
						this.chartConfig.series[0].xField = newValue;
					}
95dbfcfd   elena   save chart
350
351
				}
			}
5cfea1f2   elena   vizu draft
352
		});
f965628c   elena   plottype
353
                   
5cfea1f2   elena   vizu draft
354
355
356
		this.parCombo1 = Ext.create('Ext.form.ComboBox', {
			emptyText: 'select parameter',
			editable: false,
fded4fcb   elena   reload corrected
357
			store: this.parList,
5cfea1f2   elena   vizu draft
358
359
			queryMode: 'local',
			displayField: 'text',
95dbfcfd   elena   save chart
360
361
362
363
			valueField: 'id',
			listeners : {
				scope : this,
				change : function(combo, newValue, oldValue) {
ccb80610   elena   added options
364
					if (newValue) {						
fded4fcb   elena   reload corrected
365
366
367
368
369
						this.chartConfig.axes[1].fields = [newValue];
						var rec = combo.findRecordByValue(newValue);
						this.chartConfig.axes[1].title = rec.get('text'); 
						this.chartConfig.series[0].yField = newValue;
					}
95dbfcfd   elena   save chart
370
371
				}
			}
f965628c   elena   plottype
372
373
374
375
376
		}); 
		
		var plotTypeCombo = Ext.create('Ext.form.ComboBox', {
			emptyText: 'select plot type',
			editable: false,
ccb80610   elena   added options
377
			store: ['scatter', 'line'],
f965628c   elena   plottype
378
			queryMode: 'local',
f965628c   elena   plottype
379
			valueField: 'type',
ccb80610   elena   added options
380
			value: 'scatter',
f965628c   elena   plottype
381
382
383
384
385
386
			listeners : {
				scope : this,
				change : function(combo, newValue, oldValue) {						 
					this.chartConfig.series[0].type = newValue;
				}
			}
ccb80610   elena   added options
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
		}); 
		
		var plotThemeCombo = Ext.create('Ext.form.ComboBox', {
			emptyText: 'select theme',
			editable: false,
			store: ['Base','Green','Sky','Red','Purple','Blue','Yellow'],
			//'Category1','Category2','Category3','Category4','Category5','Category6'],
			queryMode: 'local',
			valueField: 'type',
			value: 'Blue',
			listeners : {
				scope : this,
				change : function(combo, newValue, oldValue) {						 
					this.chartConfig.theme = newValue;
				}
			}
		});
		
		var comboRangeConfig = {
		//	fieldLabel:'X Range',
			name:'scaling',
			valueField: 'scaling',
			queryMode:'local',
			store:['auto','manual'],
			forceSelection:true,
			value: 'auto',
			width: 80,
			listeners : {
				scope : this,
				change : function(combo, newValue, oldValue) {					
					var minValue = combo.next().next();
					var maxValue  = minValue.next().next();
					var disabled = newValue == "auto";
					minValue.reset();
					maxValue.reset();
					minValue.setDisabled(disabled);										  
					maxValue.setDisabled(disabled);	  										  
				}
			}
		};
		
		this.comboXrange = Ext.create('Ext.form.ComboBox', comboRangeConfig);
		this.comboYrange = Ext.create('Ext.form.ComboBox', comboRangeConfig);
		
5cfea1f2   elena   vizu draft
431
432
433
434
435
436
		var formPanel =  Ext.create('Ext.form.Panel', { 
			region : 'center',
			layout:  'hbox', 
			bodyStyle: {background : '#dfe8f6'},
			defaults: { border : false, align: 'stretch',  padding: '3'},
			fieldDefaults: { labelWidth: 80, labelAlign : 'top' },
e1fd05b4   Elena.Budnik   visu from cacheCat
437
			items: [ {            
5cfea1f2   elena   vizu draft
438
439
440
				xtype: 'form',
				flex : 1,
				bodyStyle: {background : '#dfe8f6'}, 
e1fd05b4   Elena.Budnik   visu from cacheCat
441
				items: [{ 
fded4fcb   elena   reload corrected
442
						xtype : 'fieldset',				    
e1fd05b4   Elena.Budnik   visu from cacheCat
443
						items : [{
fded4fcb   elena   reload corrected
444
445
446
447
448
449
450
							xtype: 'fieldcontainer',
							layout: 'hbox',		      
							items: [
								{ xtype:'textfield', fieldLabel: 'Catalog Name', name: 'name', readOnly: true}, 		  
								{ xtype: 'splitter' },			 			 
								{ xtype:'textfield', fieldLabel: 'Intervals', name: 'nbIntervals', readOnly: true}
							]                                                                       
e1fd05b4   Elena.Budnik   visu from cacheCat
451
452
						}]
					},{ 
fded4fcb   elena   reload corrected
453
454
455
						xtype : 'fieldset',
						title : 'X axis',
						items : [ 
e1fd05b4   Elena.Budnik   visu from cacheCat
456
457
							this.parCombo,          
							{ 
5cfea1f2   elena   vizu draft
458
459
460
								xtype : 'fieldcontainer',
								layout: 'hbox',
								items: [{
ccb80610   elena   added options
461
462
463
464
465
466
467
								xtype:'fieldset',
								title: 'X Range',
								border: false,
								layout: 'hbox',
								items: [ 
									this.comboXrange, 
									{
e1fd05b4   Elena.Budnik   visu from cacheCat
468
										xtype: 'splitter'
ccb80610   elena   added options
469
									}, {
e1fd05b4   Elena.Budnik   visu from cacheCat
470
471
472
473
										xtype: 'numberfield',
										hideTrigger: true,
										width: 50,
										disabled: true
ccb80610   elena   added options
474
									},{
e1fd05b4   Elena.Budnik   visu from cacheCat
475
										xtype: 'splitter'
ccb80610   elena   added options
476
									},{
e1fd05b4   Elena.Budnik   visu from cacheCat
477
478
479
480
										xtype: 'numberfield',
										hideTrigger: true,
										width: 50,
										disabled: true
ccb80610   elena   added options
481
									}]
fded4fcb   elena   reload corrected
482
483
								}]
							},
ccb80610   elena   added options
484
485
// 							{ xtype : 'checkbox', boxLabel: 'Logarithmic'},
							{ xtype: 'textfield', fieldLabel: 'X title', name: 'xtitle'}
fded4fcb   elena   reload corrected
486
						]
e1fd05b4   Elena.Budnik   visu from cacheCat
487
488
					},{ 
						xtype : 'fieldset',
fded4fcb   elena   reload corrected
489
490
491
492
						title : 'Y axis',
						items : [
							this.parCombo1,                   
							{ 
e1fd05b4   Elena.Budnik   visu from cacheCat
493
								xtype : 'fieldcontainer',
ccb80610   elena   added options
494
								layout: 'hbox',
e1fd05b4   Elena.Budnik   visu from cacheCat
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
								items: [{
									xtype:'fieldset',
									title: 'Y Range',
									border: false,
									layout: 'hbox',
									items: [ 
										this.comboYrange, 
										{
											xtype: 'splitter'
										}, {
											xtype: 'numberfield',
											hideTrigger: true,
											width: 50,
											disabled: true
										},{
											xtype: 'splitter'
										},{
											xtype: 'numberfield',
											hideTrigger: true,
											width: 50,
											disabled: true
ccb80610   elena   added options
516
517
									}]
								}] 
e1fd05b4   Elena.Budnik   visu from cacheCat
518
							},
ccb80610   elena   added options
519
520
521
522
523
524
525
526
// 						{ xtype : 'checkbox', boxLabel: 'Logarithmic',
// 						listeners: {
// 							scope: this,
// 							change : function( check, newValue, oldValue) {
// 								
// 							}
// 						}
// 						},
e1fd05b4   Elena.Budnik   visu from cacheCat
527
							{ xtype: 'textfield', fieldLabel: 'Y title', name: 'ytitle'}
5cfea1f2   elena   vizu draft
528
529
						]
					},
e1fd05b4   Elena.Budnik   visu from cacheCat
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
						{ 
							xtype : 'fieldset',
							title : 'Plotting Options',
							items : [
									plotTypeCombo,
									plotThemeCombo
								]
							}
						],
						fbar:[{   
							type: 'button',
							text: 'Plot',
							scope : this,
							handler: this.plotChart
							
						},{   
							type: 'button',
							text: 'Reset',
							scope : this,
							handler: this.reset
5cfea1f2   elena   vizu draft
550
						
e1fd05b4   Elena.Budnik   visu from cacheCat
551
						}]
fded4fcb   elena   reload corrected
552
					}, {
e1fd05b4   Elena.Budnik   visu from cacheCat
553
554
555
556
557
						xtype: 'form',		               
				//		    padding: '3',
						flex: 2,
						items : [ chart ],
						fbar:[
fded4fcb   elena   reload corrected
558
						{   
e1fd05b4   Elena.Budnik   visu from cacheCat
559
560
561
562
563
564
565
566
567
568
569
570
571
572
							type: 'button',
							text: 'Save Chart',
							scope: this,
							handler: function() {
								var chartPanel =  this.items.items[0].items.items[1];
								var chart = chartPanel.down('chart');
								chart.save({
									type: 'image/png',
									defaultUrl : window.location //'http://apus.irap.omp.eu/NEWAMDA/'
								});
							}
						}]
					}    
				]  
5cfea1f2   elena   vizu draft
573
		}); 
5cfea1f2   elena   vizu draft
574
575
576
577
578
579
	
		var myConf = {
			layout: 'border',
			items: [		   
				formPanel, 		     
				{
e1fd05b4   Elena.Budnik   visu from cacheCat
580
581
582
583
					xtype: 'panel', 
					region: 'south',
					title: 'Information',
					collapsible: true,
42863f42   Elena.Budnik   collapseMode: "he...
584
					collapseMode: 'header',
e1fd05b4   Elena.Budnik   visu from cacheCat
585
586
587
588
589
590
591
592
					height: 100,
					autoHide: false,
					bodyStyle: 'padding:5px',
					iconCls:  'icon-information',
					loader: {
						autoLoad: true,
						url: helpDir+'visuHOWTO'
					} 
5cfea1f2   elena   vizu draft
593
594
595
596
597
				}
			] 
		};
	    
		Ext.apply (this, Ext.apply(arguments, myConf));	
e1fd05b4   Elena.Budnik   visu from cacheCat
598
    } 
5cfea1f2   elena   vizu draft
599
});