Commit 49224f79 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

axis.js: restrict the number of labels

When we have few values, we may have several labels with the same value,
which is meaningless. In such a case, we lower the number of labels to
prevent such an issue.
parent 2c8f890d
......@@ -297,6 +297,11 @@ Axis.prototype = {
min = (min*NB_STEPS_IN_AXIS + max)/(NB_STEPS_IN_AXIS + 1)
}
if (output == 'float' || output == 'undefined') {
if (Math.abs(max - min) < nb_steps) {
nb_steps = Math.abs(max - min)
}
}
var h = (max-min)/nb_steps
// Computed so that pos <= 1 (in the loop below)
var delta = (min - max)/((min - undefined_min)/(max-undefined_min) - 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment