Nulls by default are supposed to be ignored and not rendered on bars unless nullColor is set.
The following (on my laptop - windows 7, 64bit) renders thin bars for nulls.
$('#blah').sparkline([1, null, null, 4, 5, 6, 7, 8, null, null, 11, 12, 13, 14, 15, null, null, 18, 19, 0, 21, 22, null, null, 25, 26, 27, 28], { "type": "bar" });
This appears to be related to the following from $.fn.sparkline.bar.renderRegion:
isNull = all(null, vals)
which always returns false, as the all function looks like this:
// determine if all values of an array match a value
// returns true if the array is empty
all = function (val, arr, ignoreNull) {
var i;
for (i = arr.length; i--; ) {
if (arr[i] !== val || (!ignoreNull && val === null)) {
return false;
}
}
return true;
};
and by not passing ignoreNull, the test becomes something along lines of:
if(null !== null || (!undefined && null === null)) return false;
if(false || (true && true)) return false;
The issue can be resolved by updating $.fn.sparkline.bar.renderRegion:
isNull = all(null, vals, true)