提交 582526e7 编写于 作者: L lang

Ordinal#getExtentSize => Ordinal#count

上级 ac8110ef
......@@ -88,7 +88,7 @@ define(function (require) {
var extent = this.getExtent();
if (this.onBand) {
fixExtentWithBands(extent, this.scale.getExtentSize());
fixExtentWithBands(extent, this.scale.count());
}
return linearMap(data, [0, 1], extent, clamp);
......@@ -104,7 +104,7 @@ define(function (require) {
var extent = this.getExtent();
if (this.onBand) {
fixExtentWithBands(extent, this.scale.getExtentSize());
fixExtentWithBands(extent, this.scale.count());
}
var t = linearMap(mapped, extent, [0, 1], clamp);
......@@ -161,7 +161,7 @@ define(function (require) {
getBands: function () {
var extent = this._extent;
var bands = [];
var len = this.scale.getExtentSize() + 1;
var len = this.scale.count() + 1;
var start = extent[0];
var end = extent[1];
var size = end - start;
......
......@@ -143,7 +143,7 @@ define(function (require) {
setAxis(angleAxis, angleAxisModel);
if (angleAxis.type === 'category' && ! angleAxis.onBand) {
var angle = 360 - 360 / (angleAxis.scale.getExtentSize() + 1);
var angle = 360 - 360 / (angleAxis.scale.count() + 1);
angleAxis.setExtent(0, angle);
}
......
......@@ -111,7 +111,7 @@ define(function (require) {
/**
* @return {number}
*/
getExtentSize: function () {
count: function () {
return this._extent[1] - this._extent[0];
},
......
......@@ -30,7 +30,7 @@
var data2 = [];
var data3 = [];
for (var i = 0; i < 20; i++) {
for (var i = 0; i < 10; i++) {
xAxisData.push('类目' + i);
data1.push(Math.random() * 2);
data2.push(Math.random());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册