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

axis.js: NB_STEPS_BAR

Define a constant for the number of ticks with bar plots.
Avoid hard-coded values within the code.
parent 5af9a6b5
...@@ -37,6 +37,7 @@ function Axis (model, reverse) { ...@@ -37,6 +37,7 @@ function Axis (model, reverse) {
} }
const NB_STEPS_IN_AXIS = 10; // Number (max) of labels per numerical axis const NB_STEPS_IN_AXIS = 10; // Number (max) of labels per numerical axis
const NB_STEPS_BAR = 30; // Number (max) of labels per numerical axis in histograms
Axis.prototype = { Axis.prototype = {
...@@ -336,7 +337,7 @@ Axis.prototype = { ...@@ -336,7 +337,7 @@ Axis.prototype = {
this.labels = []; this.labels = [];
var length = Object.keys(tab).length; var length = Object.keys(tab).length;
var step = 1 + Math.floor(length / 30) var step = 1 + Math.floor(length / NB_STEPS_BAR)
var i=1 var i=1
for (var e in tab){ for (var e in tab){
......
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