diff --git a/lib/cartodb/models/dataview/histogram.js b/lib/cartodb/models/dataview/histogram.js index 01b62148..c2df2c5f 100644 --- a/lib/cartodb/models/dataview/histogram.js +++ b/lib/cartodb/models/dataview/histogram.js @@ -583,7 +583,7 @@ module.exports = class Histogram extends BaseWidget { override = override || {}; var buckets = []; - var binsCount = getBinsCount(override); + var binsCount = this.getBinsCount(override); var width = getWidth(override); var binsStart = this.getBinStart(override); var nulls = 0; @@ -694,6 +694,9 @@ module.exports = class Histogram extends BaseWidget { return override.end || 0; } + getBinsCount (override) { + return override.bins || 0; + } }; var DATE_AGGREGATIONS = { @@ -707,10 +710,6 @@ var DATE_AGGREGATIONS = { 'year': true }; -function getBinsCount(override) { - return override.bins || 0; -} - function getWidth(override) { var width = 0; var binsCount = override.bins;