Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/scales/scale.logarithmic.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,32 +161,30 @@ module.exports = function(Chart) {
var me = this;
var opts = me.options;
var tickOpts = opts.ticks;
var reverse = !me.isHorizontal();

var generationOptions = {
min: tickOpts.min,
max: tickOpts.max
};
var ticks = me.ticks = Ticks.generators.logarithmic(generationOptions, me);

if (!me.isHorizontal()) {
// We are in a vertical orientation. The top value is the highest. So reverse the array
ticks.reverse();
}

// At this point, we need to update our max and min given the tick values since we have expanded the
// range of the scale
me.max = helpers.max(ticks);
me.min = helpers.min(ticks);

if (tickOpts.reverse) {
ticks.reverse();

reverse = !reverse;
me.start = me.max;
me.end = me.min;
} else {
me.start = me.min;
me.end = me.max;
}
if (reverse) {
ticks.reverse();
}
},
convertTicksToLabels: function() {
this.tickValues = this.ticks.slice();
Expand Down