From 1962836b383a40ccf747687f96412a2c2238ecf3 Mon Sep 17 00:00:00 2001 From: Furkan Date: Thu, 3 Nov 2022 15:25:04 +0100 Subject: [PATCH] #10743 - Done --- js/app/views/CatalogVisuHistogram.js | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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