diff --git a/src/chart/helper/DataSymbol.js b/src/chart/helper/DataSymbol.js index 3231f50471e183685c6acda28e840e0c11536b92..fa1a28ce48f0317dc3c661c4d60fe3257ae0e81c 100644 --- a/src/chart/helper/DataSymbol.js +++ b/src/chart/helper/DataSymbol.js @@ -101,7 +101,6 @@ define(function (require) { var group = this.group; this._data.each(function (dataItem) { var el = dataItem.__el; - el.stopAnimation(); el.animateTo({ scale: [0, 0] }, 200, 'cubicOut', function () { diff --git a/src/chart/line/LineView.js b/src/chart/line/LineView.js index a70c750d33af491fad84fff0a386953de0a347b3..359e78a17d0e84fa4bf606561ea025b63774183a 100644 --- a/src/chart/line/LineView.js +++ b/src/chart/line/LineView.js @@ -39,14 +39,6 @@ define(function(require) { // Initialization animation if (!this._data) { - var removeClipPath = zrUtil.bind(group.removeClipPath, group); - - var clipPath = isCoordinateSystemPolar - ? this._createPolarClipShape(coordinateSystem, api, removeClipPath) - : this._createGridClipShape(coordinateSystem, api, removeClipPath); - - group.setClipPath(clipPath); - var polyline = new api.Polyline({ shape: { points: points @@ -59,6 +51,14 @@ define(function(require) { ) }); + var removeClipPath = zrUtil.bind(polyline.removeClipPath, polyline); + + var clipPath = isCoordinateSystemPolar + ? this._createPolarClipShape(coordinateSystem, api, removeClipPath) + : this._createGridClipShape(coordinateSystem, api, removeClipPath); + + polyline.setClipPath(clipPath); + group.add(polyline); this._polyline = polyline; diff --git a/src/coord/Axis.js b/src/coord/Axis.js index e1cddad99d5817542bef29bdc611630f9cdb03b3..1961738326879892753675e0514ded517f4bb78b 100644 --- a/src/coord/Axis.js +++ b/src/coord/Axis.js @@ -161,15 +161,15 @@ define(function (require) { getBands: function () { var extent = this._extent; var bands = []; - var len = this.scale.count() + 1; + var len = this.scale.count(); var start = extent[0]; var end = extent[1]; var size = end - start; - for (var i = 1; i <= len; i++) { + for (var i = 0; i < len; i++) { bands.push([ - size * (i - 1) / len + start, - size * i / len + start + size * i / len + start, + size * (i + 1) / len + start ]); } return bands; diff --git a/src/scale/Ordinal.js b/src/scale/Ordinal.js index 1f90d33b46c4e73de4fe0609ab3615648e1ab8a6..311784da4b80f423fe993c13e5bfee2d49482fea 100644 --- a/src/scale/Ordinal.js +++ b/src/scale/Ordinal.js @@ -5,6 +5,7 @@ * http://en.wikipedia.org/wiki/Level_of_measurement */ +// FIXME only one data define(function (require) { /** @@ -37,6 +38,10 @@ define(function (require) { */ normalize: function (val) { var extent = this._extent; + // Only one data + if (extent[1] === extent[0]) { + return extent[0]; + } return (val - extent[0]) / (extent[1] - extent[0]); }, @@ -112,7 +117,7 @@ define(function (require) { * @return {number} */ count: function () { - return this._extent[1] - this._extent[0]; + return this._extent[1] - this._extent[0] + 1; }, /** diff --git a/src/util/number.js b/src/util/number.js index 2c33440af57926f192bbfb27d9cbc0d1f889d703..6118992f7ec06b88f2903e62a81d2000fcffbbdd 100644 --- a/src/util/number.js +++ b/src/util/number.js @@ -22,7 +22,7 @@ define(function (require) { var sub = domain[1] - domain[0]; if (sub === 0) { - return val; + return domain[0]; } var t = (val - domain[0]) / sub; if (clamp) {