diff --git a/js/app/models/PlotObjects/PlotAxisObject.js b/js/app/models/PlotObjects/PlotAxisObject.js index 1fe6a86..b10996a 100644 --- a/js/app/models/PlotObjects/PlotAxisObject.js +++ b/js/app/models/PlotObjects/PlotAxisObject.js @@ -95,8 +95,8 @@ Ext.define('amdaPlotObj.PlotAxisObject', { this.set('axis-thickness', amdaPlotObj.PlotObjectConfig.defaultValues.axis.thickness); this.set('axis-tick-showmarks', true); this.set('axis-tick-position', amdaPlotObj.PlotObjectConfig.defaultValues.axis.tickPosition); - this.set('axis-grid-minor-number',0); - this.set('axis-grid-major-number',0); + this.set('axis-grid-minor-number',1); + this.set('axis-grid-major-number',1); this.set('axis-grid-minor-space',0); this.set('axis-grid-major-space',0); this.set('axis-grid-minor', false); diff --git a/js/app/views/PlotComponents/PlotBaseAxisForm.js b/js/app/views/PlotComponents/PlotBaseAxisForm.js index 943c511..6df0343 100644 --- a/js/app/views/PlotComponents/PlotBaseAxisForm.js +++ b/js/app/views/PlotComponents/PlotBaseAxisForm.js @@ -15,8 +15,7 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { showColorOption : true, showRangeOptions : true, showTickGridOptions : true, - disableTicksSpacing : true, - disableTicksNumbers : true, + showTicksNumberSpacing : true, getFormItems: function() { var me = this; @@ -32,7 +31,6 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { this.addStandardFont('axis-legend-font') ]; var manageTicksNumber = function (name, newValue, oldValue){ - var disableTicksNumbers = me.getForm( ).findField('axis-grid-minor-number').disabled me.getForm( ).findField('axis-grid-minor-number').setDisabled( !newValue); me.getForm( ).findField('axis-grid-major-number').setDisabled( !newValue); if( newValue){ @@ -42,29 +40,28 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { } }; var manageTicksSpacing = function (name, newValue, oldValue){ - var disableTicksSacing = me.getForm( ).findField('axis-grid-minor-space').disabled me.getForm( ).findField('axis-grid-minor-space').setDisabled( !newValue ); me.getForm( ).findField('axis-grid-major-space').setDisabled( !newValue ); if( newValue ){ me.getForm( ).findField('axis-grid-minor-number').setDisabled(newValue); me.getForm( ).findField('axis-grid-major-number').setDisabled(newValue); - me.getForm( ).findField('axis-grid-specify-ticks-number').setValue(!newValuee); + me.getForm( ).findField('axis-grid-specify-ticks-number').setValue(!newValue); } }; var tickGridItems = [ this.addStandardCombo('axis-tick-position', 'Ticks position', amdaPlotObj.PlotObjectConfig.availableTicksPositions), this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'), this.addStandardCheck('axis-grid-major', 'Show major grid'), - this.addStandardCheck('axis-grid-minor', 'Show minor grid'), - this.addStandardCheck('axis-grid-specify-ticks-number', 'Specify ticks number', manageTicksNumber), - this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 0, Number.MAX_VALUE,true,true), - this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 0, Number.MAX_VALUE,true,true), - this.addStandardCheck('axis-grid-specify-ticks-spacing', 'Specify ticks spacing',manageTicksSpacing), - this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true,true), - this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true,true), - - ]; - + this.addStandardCheck('axis-grid-minor', 'Show minor grid')]; + if (this.showTicksNumberSpacing){ + tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-number', 'Specify ticks number', manageTicksNumber)); + tickGridItems.push(this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 1, Number.MAX_VALUE,true,true)); + tickGridItems.push(this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 1, Number.MAX_VALUE,true,true)); + tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-spacing', 'Specify ticks spacing',manageTicksSpacing)); + tickGridItems.push(this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true,true)); + tickGridItems.push(this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true,true)); + }; + var axisItems = []; if (this.showScaleOption) axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaPlotObj.PlotObjectConfig.availableAxisScales)); diff --git a/js/app/views/PlotComponents/PlotEpochAxisForm.js b/js/app/views/PlotComponents/PlotEpochAxisForm.js index 8622d37..431d269 100644 --- a/js/app/views/PlotComponents/PlotEpochAxisForm.js +++ b/js/app/views/PlotComponents/PlotEpochAxisForm.js @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotEpochAxisForm', { showScaleOption : false, showRangeOptions : false, + showTicksNumberSpacing : false, getFormItems: function() { var epochItems = [ diff --git a/js/app/views/PlotComponents/PlotTimeAxisForm.js b/js/app/views/PlotComponents/PlotTimeAxisForm.js index e611e79..dabf02d 100644 --- a/js/app/views/PlotComponents/PlotTimeAxisForm.js +++ b/js/app/views/PlotComponents/PlotTimeAxisForm.js @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotTimeAxisForm', { showScaleOption : false, showRangeOptions : false, + showTicksNumberSpacing : false, getFormItems: function() { var timeItems = [ -- libgit2 0.21.2