diff --git a/js/app/views/CatalogVisuHistogram.js b/js/app/views/CatalogVisuHistogram.js index e30e922..3446982 100644 --- a/js/app/views/CatalogVisuHistogram.js +++ b/js/app/views/CatalogVisuHistogram.js @@ -10,6 +10,11 @@ Ext.define('amdaUI.CatalogVisuHistogram', { extend: 'Ext.form.Panel', alias: 'widget.panelCatalogVisuHistogram', + requires: [ + 'amdaPlotObj.PlotObjectConfig', + 'amdaPlotComp.PlotColorPicker' + ], + histogramStore: null, visuUI:null, constructor: function(config) { @@ -23,6 +28,10 @@ Ext.define('amdaUI.CatalogVisuHistogram', { title: 'Parameter' }; + var plotColorField = Ext.getCmp('visu-histo-color'); + var plotColor=plotColorField.ownerCt.colorDisplayer.value; + console.log(plotColorField, plotColor); + var paramField = Ext.getCmp('visu-histo-param'); var paramFieldId = paramField.getValue(); if (paramFieldId && (paramFieldId != "")) { @@ -71,6 +80,9 @@ Ext.define('amdaUI.CatalogVisuHistogram', { var trace = { x: x, type: 'histogram', + marker:{ + color:plotColor, + }, histnorm: Ext.getCmp('normalizedCheckbox').getValue() ? 'probability': null, xbins: { end: maxValue, size: binSize, start: minValue } }; @@ -145,6 +157,15 @@ Ext.define('amdaUI.CatalogVisuHistogram', { } ], }; + var colorPicker = this.addColorsPicker('visu-histo-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'standard'); + var plotThemeComboConfig = {xtype:'fieldset', + id:'visu-hiso-color-fieldset', + margin:'5 0 0 0', + border:false, + items:[colorPicker], + }; + colorPicker.add({id:'visu-histo-color'}); + var sliderConfig = { xtype : 'fieldcontainer', layout: 'hbox', @@ -209,11 +230,23 @@ Ext.define('amdaUI.CatalogVisuHistogram', { }, scope: this } - } + }, + + plotThemeComboConfig, ] }; }, + addColorsPicker: function (name, label, availableColors, mode) { + if (!mode) { + mode = 'standard'; + } + var me =this; + return new amdaPlotComp.PlotColorPicker({name: name, label: label, mode: mode, colors: availableColors, onChange: function(name, newValue, oldValue) { + me.visuUI.plotChart(); + }}); + }, + init : function (config) { var myConf = { -- libgit2 0.21.2