js/scatterPlot.js, js/generic_axis.js: extract barTab computation to GenericAxis

See #2700.
9 jobs for feature-c/2641-generic-axis-init in 5 minutes and 47 seconds (queued for 3 seconds)