Merge pull request #1875 from michaelarnauts/master

Ignore null values when calculating scale
This commit is contained in:
Evert Timberg
2016-01-09 09:40:07 -05:00

View File

@@ -409,8 +409,13 @@
maxSteps = Math.floor(drawingSize/(textSize * 1.5)),
skipFitting = (minSteps >= maxSteps);
var maxValue = max(valuesArray),
minValue = min(valuesArray);
// Filter out null values since these would min() to zero
var values = [];
each(valuesArray, function( v ){
v == null || values.push( v );
});
var minValue = min(values),
maxValue = max(values);
// We need some degree of separation here to calculate the scales if all the values are the same
// Adding/minusing 0.5 will give us a range of 1.