File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -161,32 +161,30 @@ module.exports = function(Chart) {
161
161
var me = this ;
162
162
var opts = me . options ;
163
163
var tickOpts = opts . ticks ;
164
+ var reverse = ! me . isHorizontal ( ) ;
164
165
165
166
var generationOptions = {
166
167
min : tickOpts . min ,
167
168
max : tickOpts . max
168
169
} ;
169
170
var ticks = me . ticks = Ticks . generators . logarithmic ( generationOptions , me ) ;
170
171
171
- if ( ! me . isHorizontal ( ) ) {
172
- // We are in a vertical orientation. The top value is the highest. So reverse the array
173
- ticks . reverse ( ) ;
174
- }
175
-
176
172
// At this point, we need to update our max and min given the tick values since we have expanded the
177
173
// range of the scale
178
174
me . max = helpers . max ( ticks ) ;
179
175
me . min = helpers . min ( ticks ) ;
180
176
181
177
if ( tickOpts . reverse ) {
182
- ticks . reverse ( ) ;
183
-
178
+ reverse = ! reverse ;
184
179
me . start = me . max ;
185
180
me . end = me . min ;
186
181
} else {
187
182
me . start = me . min ;
188
183
me . end = me . max ;
189
184
}
185
+ if ( reverse ) {
186
+ ticks . reverse ( ) ;
187
+ }
190
188
} ,
191
189
convertTicksToLabels : function ( ) {
192
190
this . tickValues = this . ticks . slice ( ) ;
You can’t perform that action at this time.
0 commit comments