提交 02d93ac6 编写于 作者: K kener

代码优化

上级 269e19fd
......@@ -425,15 +425,13 @@ define(function (require) {
var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex);
return [
typeof mpData.xAxis != 'string'
&& xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.yAxis != 'string'
&& yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
];
},
......
......@@ -851,15 +851,13 @@ define(function (require) {
}
return [
typeof mpData.xAxis != 'string'
&& xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.yAxis != 'string'
&& yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
];
},
......
......@@ -422,15 +422,13 @@ define(function (require) {
}
else {
pos = [
typeof mpData.xAxis != 'string'
&& xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex
? xAxis.getCoordByIndex(mpData.xAxis || 0)
: xAxis.getCoord(mpData.xAxis || 0),
typeof mpData.yAxis != 'string'
&& yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex
? yAxis.getCoordByIndex(mpData.yAxis || 0)
: yAxis.getCoord(mpData.yAxis || 0)
];
}
......
......@@ -748,6 +748,8 @@ define(function (require) {
return i;
}
}
return -1;
},
/**
......
......@@ -1038,13 +1038,12 @@ define(function (require) {
},
getRealDataIndex : function (sIdx, dIdx) {
if (!this._originalData) {
if (!this._originalData || (this._zoom.start == 0 && this._zoom.end == 100)) {
return dIdx;
}
var sreies = this._originalData.series;
if (sreies[sIdx]) {
return Math.floor(this._zoom.start / 100 * sreies[sIdx].length)
+ dIdx;
return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx;
}
return -1;
},
......
......@@ -187,7 +187,7 @@ define(function() {
title : {
line : '折线图切换',
bar : '柱形图切换',
stack : '',
stack : '',
tiled : '平铺'
},
type : [] // 'line', 'bar', 'stack', 'tiled'
......
......@@ -124,7 +124,6 @@ function option(chartType, n) {
else if (chartType == 'chord') {
opt.series = chordSeries();
}
return opt;
}
......@@ -183,7 +182,7 @@ function pieData(n){
function chordSeries() {
return [
{
"name": "支持",
"name": "性能测试",
"type": "chord",
"showScaleText": false,
"data": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册