提交 e10277ee 编写于 作者: L lang

List entry 不混淆 getY 和 getValue

上级 ad838340
......@@ -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);
......
......@@ -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);
});
}
......
......@@ -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 () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册