Commit a3ed599fff5c5898da9377403881e41c0dd37083
1 parent
5b64c444
Exists in
master
and in
101 other branches
rm 6954 ok
Showing
3 changed files
with
39 additions
and
1 deletions
Show diff stats
js/app/models/PlotObjects/PlotAxisObject.js
... | ... | @@ -36,6 +36,10 @@ Ext.define('amdaPlotObj.PlotAxisObject', { |
36 | 36 | {name: 'axis-tick-position', type: 'string'}, |
37 | 37 | {name: 'axis-grid-minor', type: 'boolean'}, |
38 | 38 | {name: 'axis-grid-major', type: 'boolean'}, |
39 | + {name:'axis-grid-minor-number',type:'int'}, | |
40 | + {name:'axis-grid-major-number',type:'int'}, | |
41 | + {name:'axis-grid-major-space',type:'float'}, | |
42 | + {name:'axis-grid-minor-space',type:'float'}, | |
39 | 43 | {name: 'axis-legend-activated', type: 'boolean'}, |
40 | 44 | {name: 'axis-legend-text', type: 'string'}, |
41 | 45 | {name: 'axis-legend-color', type: 'string'}, |
... | ... | @@ -89,6 +93,10 @@ Ext.define('amdaPlotObj.PlotAxisObject', { |
89 | 93 | this.set('axis-thickness', amdaPlotObj.PlotObjectConfig.defaultValues.axis.thickness); |
90 | 94 | this.set('axis-tick-showmarks', true); |
91 | 95 | this.set('axis-tick-position', amdaPlotObj.PlotObjectConfig.defaultValues.axis.tickPosition); |
96 | + this.set('axis-grid-minor-number',0); | |
97 | + this.set('axis-grid-major-number',0); | |
98 | + this.set('axis-grid-minor-space',0); | |
99 | + this.set('axis-grid-major-space',0); | |
92 | 100 | this.set('axis-grid-minor', false); |
93 | 101 | this.set('axis-grid-major', false); |
94 | 102 | this.set('axis-legend-activated', true); |
... | ... | @@ -128,6 +136,10 @@ Ext.define('amdaPlotObj.PlotAxisObject', { |
128 | 136 | axisValues['axis-tick-position'] = this.get('axis-tick-position'); |
129 | 137 | axisValues['axis-grid-minor'] = this.get('axis-grid-minor'); |
130 | 138 | axisValues['axis-grid-major'] = this.get('axis-grid-major'); |
139 | + axisValues['axis-grid-minor-number']=this.get('axis-grid-minor-number'); | |
140 | + axisValues['axis-grid-major-number']=this.get('axis-grid-major-number'); | |
141 | + axisValues['axis-grid-minor-space']=this.get('axis-grid-minor-space'); | |
142 | + axisValues['axis-grid-major-space']=this.get('axis-grid-major-space'); | |
131 | 143 | axisValues['axis-legend-activated'] = this.get('axis-legend-activated'); |
132 | 144 | axisValues['axis-legend-text'] = this.get('axis-legend-text'); |
133 | 145 | axisValues['axis-legend-color'] = this.get('axis-legend-color'); |
... | ... |
js/app/views/PlotComponents/PlotBaseAxisForm.js
... | ... | @@ -33,7 +33,11 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { |
33 | 33 | this.addStandardCombo('axis-tick-position', 'Ticks position', amdaPlotObj.PlotObjectConfig.availableTicksPositions), |
34 | 34 | this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'), |
35 | 35 | this.addStandardCheck('axis-grid-major', 'Show major grid'), |
36 | - this.addStandardCheck('axis-grid-minor', 'Show minor grid') | |
36 | + this.addStandardCheck('axis-grid-minor', 'Show minor grid'), | |
37 | + this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 0, Number.MAX_VALUE,true), | |
38 | + this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 0, Number.MAX_VALUE,true), | |
39 | + this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true), | |
40 | + this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true) | |
37 | 41 | ]; |
38 | 42 | |
39 | 43 | var axisItems = []; |
... | ... |
js/app/views/PlotComponents/PlotStandardForm.js
... | ... | @@ -81,6 +81,28 @@ Ext.define('amdaPlotComp.PlotStandardForm', { |
81 | 81 | } |
82 | 82 | }; |
83 | 83 | }, |
84 | + addStandardInteger: function(name, label, min, max, allowBlank, onChange) { | |
85 | + allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false; | |
86 | + | |
87 | + return { | |
88 | + xtype: 'numberfield', | |
89 | + name: name, | |
90 | + fieldLabel: label, | |
91 | + regex:/^\d+$/, | |
92 | + decimalPrecision : 20, | |
93 | + minValue : min, | |
94 | + maxValue : max, | |
95 | + allowBlank : allowBlank, | |
96 | + listeners: { | |
97 | + change: function(field, newValue, oldValue, eOpts) { | |
98 | + this.object.set(name, newValue); | |
99 | + if (onChange != null) | |
100 | + onChange(name, newValue, oldValue); | |
101 | + }, | |
102 | + scope: this | |
103 | + } | |
104 | + }; | |
105 | + }, | |
84 | 106 | |
85 | 107 | addStandardFloat2: function(name, label, min, max, allowBlank, onChange) { |
86 | 108 | allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false; |
... | ... |