Commit 3c7ba0d9fcfea80ce695dcf0d964c0300f8945fb
1 parent
77d927cd
Exists in
master
and in
48 other branches
#10702/10701 - Log Scale on X axis for histogram plot
Showing
1 changed file
with
27 additions
and
22 deletions
Show diff stats
js/app/views/CatalogVisuHistogram.js
... | ... | @@ -60,7 +60,8 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
60 | 60 | myDesktopApp.errorMsg('Not enough data or constant data'); |
61 | 61 | return null; |
62 | 62 | } |
63 | - var isLogScale = Ext.getCmp('visu-scatter-logbox').getValue(); | |
63 | + var isLogScaleX = Ext.getCmp('visu-histo-logbox-X').getValue(); | |
64 | + var isLogScaleY = Ext.getCmp('visu-histo-logbox-Y').getValue(); | |
64 | 65 | var binSize = (maxValue-minValue) / (nbBinsValue); |
65 | 66 | var x=[]; |
66 | 67 | catalogStore.each(function (item) { |
... | ... | @@ -79,15 +80,36 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
79 | 80 | margin: {l: 60,r: 40, b: 40,t: 40,pad: 5}, |
80 | 81 | yaxis: { |
81 | 82 | title: Ext.getCmp('normalizedCheckbox').getValue() ? 'Frequency': 'Events', |
82 | - type: isLogScale ? 'log' : null | |
83 | + type: isLogScaleY ? 'log' : null | |
83 | 84 | }, |
84 | - xaxis: {title: paramOpt.title}, | |
85 | + xaxis: { | |
86 | + title: paramOpt.title, | |
87 | + type: isLogScaleX ? 'log' : null}, | |
85 | 88 | }; |
86 | 89 | |
87 | 90 | var result = {data:data,layout:layout} |
88 | 91 | return result; |
89 | 92 | }, |
90 | 93 | |
94 | + generateLogBox: function(axis){ | |
95 | + return {xtype: 'fieldcontainer', | |
96 | + fieldLabel: axis+' Log Scale', | |
97 | + defaultType: 'checkboxfield', | |
98 | + items: [ | |
99 | + { | |
100 | + name : 'logscale'+axis, | |
101 | + inputValue: false, | |
102 | + id : 'visu-histo-logbox-'+axis, | |
103 | + listeners:{ | |
104 | + change:function(){ | |
105 | + this.visuUI.plotChart(); | |
106 | + }, | |
107 | + scope: this | |
108 | + } | |
109 | + } | |
110 | + ],} | |
111 | + }, | |
112 | + | |
91 | 113 | getHistoConfig: function(parametersStore) { |
92 | 114 | var paramComboConfig = { |
93 | 115 | xtype: 'combo', |
... | ... | @@ -105,24 +127,6 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
105 | 127 | scope: this |
106 | 128 | } |
107 | 129 | }; |
108 | - var logbox={ | |
109 | - xtype: 'fieldcontainer', | |
110 | - fieldLabel: 'Log Scale', | |
111 | - defaultType: 'checkboxfield', | |
112 | - items: [ | |
113 | - { | |
114 | - name : 'logscale', | |
115 | - inputValue: false, | |
116 | - id : 'visu-scatter-logbox', | |
117 | - listeners:{ | |
118 | - change:function(){ | |
119 | - this.visuUI.plotChart(); | |
120 | - }, | |
121 | - scope: this | |
122 | - } | |
123 | - } | |
124 | - ], | |
125 | - }; | |
126 | 130 | var normalizedbox={ |
127 | 131 | xtype: 'fieldcontainer', |
128 | 132 | fieldLabel: 'Normalized', |
... | ... | @@ -193,7 +197,8 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
193 | 197 | paramComboConfig, |
194 | 198 | sliderConfig, |
195 | 199 | normalizedbox, |
196 | - logbox, | |
200 | + this.generateLogBox('X'), | |
201 | + this.generateLogBox('Y'), | |
197 | 202 | { |
198 | 203 | xtype: 'textfield', |
199 | 204 | fieldLabel: 'Title', | ... | ... |