Commit 1962836b383a40ccf747687f96412a2c2238ecf3
1 parent
719e6220
Exists in
master
and in
48 other branches
#10743 - Done
Showing
1 changed file
with
34 additions
and
1 deletions
Show diff stats
js/app/views/CatalogVisuHistogram.js
... | ... | @@ -10,6 +10,11 @@ |
10 | 10 | Ext.define('amdaUI.CatalogVisuHistogram', { |
11 | 11 | extend: 'Ext.form.Panel', |
12 | 12 | alias: 'widget.panelCatalogVisuHistogram', |
13 | + requires: [ | |
14 | + 'amdaPlotObj.PlotObjectConfig', | |
15 | + 'amdaPlotComp.PlotColorPicker' | |
16 | + ], | |
17 | + | |
13 | 18 | histogramStore: null, |
14 | 19 | visuUI:null, |
15 | 20 | constructor: function(config) { |
... | ... | @@ -23,6 +28,10 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
23 | 28 | title: 'Parameter' |
24 | 29 | }; |
25 | 30 | |
31 | + var plotColorField = Ext.getCmp('visu-histo-color'); | |
32 | + var plotColor=plotColorField.ownerCt.colorDisplayer.value; | |
33 | + console.log(plotColorField, plotColor); | |
34 | + | |
26 | 35 | var paramField = Ext.getCmp('visu-histo-param'); |
27 | 36 | var paramFieldId = paramField.getValue(); |
28 | 37 | if (paramFieldId && (paramFieldId != "")) { |
... | ... | @@ -71,6 +80,9 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
71 | 80 | var trace = { |
72 | 81 | x: x, |
73 | 82 | type: 'histogram', |
83 | + marker:{ | |
84 | + color:plotColor, | |
85 | + }, | |
74 | 86 | histnorm: Ext.getCmp('normalizedCheckbox').getValue() ? 'probability': null, |
75 | 87 | xbins: { end: maxValue, size: binSize, start: minValue } |
76 | 88 | }; |
... | ... | @@ -145,6 +157,15 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
145 | 157 | } |
146 | 158 | ], |
147 | 159 | }; |
160 | + var colorPicker = this.addColorsPicker('visu-histo-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'standard'); | |
161 | + var plotThemeComboConfig = {xtype:'fieldset', | |
162 | + id:'visu-hiso-color-fieldset', | |
163 | + margin:'5 0 0 0', | |
164 | + border:false, | |
165 | + items:[colorPicker], | |
166 | + }; | |
167 | + colorPicker.add({id:'visu-histo-color'}); | |
168 | + | |
148 | 169 | var sliderConfig = { |
149 | 170 | xtype : 'fieldcontainer', |
150 | 171 | layout: 'hbox', |
... | ... | @@ -209,11 +230,23 @@ Ext.define('amdaUI.CatalogVisuHistogram', { |
209 | 230 | }, |
210 | 231 | scope: this |
211 | 232 | } |
212 | - } | |
233 | + }, | |
234 | + | |
235 | + plotThemeComboConfig, | |
213 | 236 | ] |
214 | 237 | }; |
215 | 238 | }, |
216 | 239 | |
240 | + addColorsPicker: function (name, label, availableColors, mode) { | |
241 | + if (!mode) { | |
242 | + mode = 'standard'; | |
243 | + } | |
244 | + var me =this; | |
245 | + return new amdaPlotComp.PlotColorPicker({name: name, label: label, mode: mode, colors: availableColors, onChange: function(name, newValue, oldValue) { | |
246 | + me.visuUI.plotChart(); | |
247 | + }}); | |
248 | + }, | |
249 | + | |
217 | 250 | init : function (config) |
218 | 251 | { |
219 | 252 | var myConf = { | ... | ... |