Bugfix: zero value regression (#59).

This commit is contained in:
Olly Smith 2012-05-15 22:39:37 +01:00
parent 942e121caa
commit aa67b1a305
5 changed files with 13 additions and 10 deletions

View File

@ -29,6 +29,11 @@ Tests use [qunit](http://docs.jquery.com/QUnit), and are in `test.html`.
## Changelog
### 0.2.9 - 15th May 2012
- Bugfix: Fix zero-value regression
- Bugfix: Don't modify user-supplied data
### 0.2.8 - 10th May 2012
- Customising x-axis labels with `xLabelFormat` option

View File

@ -16,13 +16,13 @@
/* data stolen from http://howmanyleft.co.uk/vehicle/jaguar_'e'_type */
var day_data = [
{"period": "2012-10-01", "licensed": 3407},
{"period": "2012-09-30", "sorned": 629},
{"period": "2012-09-30", "sorned": 0},
{"period": "2012-09-29", "sorned": 618},
{"period": "2012-09-20", "licensed": 3246, "sorned": 661},
{"period": "2012-09-19", "licensed": 3257, "sorned": null},
{"period": "2012-09-18", "licensed": 3248},
{"period": "2012-09-17", "sorned": 660},
{"period": "2012-09-16", "sorned": 676},
{"period": "2012-09-17", "sorned": 0},
{"period": "2012-09-16", "sorned": 0},
{"period": "2012-09-15", "licensed": 3201, "sorned": 656},
{"period": "2012-09-10", "licensed": 3215}
];

View File

@ -87,7 +87,7 @@ class Morris.Line
for ykey in @options.ykeys
series_data = []
for d in @options.data
series_data.push(d[ykey] or null)
series_data.push(if typeof d[ykey] == 'number' then d[ykey] else null)
@series.push(series_data)
# translate x labels into nominal dates

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.1
// Generated by CoffeeScript 1.3.3
(function() {
var $, Morris, minutesSpecHelper, secondsSpecHelper,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@ -9,8 +9,6 @@
Morris.Line = (function() {
Line.name = 'Line';
function Line(options) {
this.updateHilight = __bind(this.updateHilight, this);
@ -99,7 +97,7 @@
_ref1 = this.options.data;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
d = _ref1[_j];
series_data.push(d[ykey] || null);
series_data.push(typeof d[ykey] === 'number' ? d[ykey] : null);
}
this.series.push(series_data);
}

4
morris.min.js vendored

File diff suppressed because one or more lines are too long