diff --git a/src/coord/cartesian/Cartesian2D.js b/src/coord/cartesian/Cartesian2D.js index b3a9010a3379d080bbc75615693f8f6b7326aeec..42b94b3121e503cb73c81f9ea6a50c8c6dc041a9 100644 --- a/src/coord/cartesian/Cartesian2D.js +++ b/src/coord/cartesian/Cartesian2D.js @@ -34,7 +34,7 @@ define(function(require) { var categoryAxis = this.getAxesByScale('ordinal')[0]; var swapAxis = categoryAxis && categoryAxis.dim === 'y'; var x = dataItem.getX(); - var y = dataItem.getY(); + var y = categoryAxis ? dataItem.getValue() : dataItem.getY(); var coord = []; coord[xIndex] = xAxis.dataToCoord(swapAxis ? y : x); diff --git a/src/coord/cartesian/Grid.js b/src/coord/cartesian/Grid.js index 7681a34dccee061b30681b563403218c557825f9..624e1e43a8fa0e420af86199e85171650dfdad47 100644 --- a/src/coord/cartesian/Grid.js +++ b/src/coord/cartesian/Grid.js @@ -254,7 +254,7 @@ define(function(require, factory) { }); } else { - data.eachY(function (value) { + data.eachValue(function (value) { axisData[categoryAxis.dim == 'y' ? 'x' : 'y'].push(value); }); } diff --git a/src/data/List.js b/src/data/List.js index e99faaa535480bc414e75ae5f020d374d6a10abc..8cfd6a20d2258bc0e46e9a4f2a630456f1f31acd 100644 --- a/src/data/List.js +++ b/src/data/List.js @@ -86,10 +86,6 @@ define(function(require) { if (this.dimension > 1) { return this._value[1]; } - else { - // Value is a single number if data is 1d - return this._value; - } }, /** @@ -99,9 +95,6 @@ define(function(require) { if (this.dimension > 1) { this._value[1] = y; } - else { - this._value = y; - } }, /** @@ -126,6 +119,11 @@ define(function(require) { * @return {number} */ getValue: function () { + // PENDING + // Value is a single number if data is 1d + if (this.dimension === 1) { + return this._value; + } return this._value[this.dimension]; }, @@ -133,7 +131,12 @@ define(function(require) { * @param {number} value */ setValue: function (value) { - this._value[this.dimension] = value + if (this.dimension === 1) { + this._value = value; + } + else { + this._value[this.dimension] = value + } }, clone: function () {