提交 adce337d 编写于 作者: K kener

代码优化

上级 cff554f0
......@@ -130,6 +130,9 @@ function option1 (name) {
for (var i = 0, l = keyCity.length; i < l; i++) {
city = keyCity[i];
singleData = cityToData[city];
if (typeof singleData == 'undefined') {
continue;
}
seriesData = [
singleData.aqi,
singleData.pm2_5,
......
......@@ -136,7 +136,7 @@ function option3 (name) {
{name:'黑龙江', value:data.cityToData['哈尔滨'][key]},
{name:'内蒙古', value:data.cityToData['呼和浩特'][key]},
{name:'安徽', value:data.cityToData['合肥'][key]},
{name:'北京', value:data.cityToData['北京'][key]},
{name:'北京', value:(data.cityToData['北京'] || {})[key]},
{name:'福建', value:data.cityToData['福州'][key]},
{name:'上海', value:data.cityToData['上海'][key]},
{name:'湖北', value:data.cityToData['武汉'][key]},
......
......@@ -348,8 +348,10 @@ define(function (require) {
y : newShape._orient == 'vertical'
? newShape.style.y + newShape.style.height
: newShape.style.y,
width: 0,
height: 0
width: newShape._orient == 'vertical'
? newShape.style.width : 0,
height: newShape._orient != 'vertical'
? newShape.style.height : 0
}
},
newShape,
......
......@@ -147,7 +147,7 @@ define(function (require) {
}
valueCalculation[mapType] = valueCalculation[mapType]
|| series[i].mapValueCalculation;
|| series[i].mapValueCalculation;
seriesName = series[i].name;
this.selectedMap[seriesName] = legend
......@@ -733,7 +733,6 @@ define(function (require) {
style.lineJoin = highlightStyle.lineJoin = 'round';
style._name = highlightStyle._name = name;
font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle');
// 文字标签避免覆盖单独一个shape
textShape = {
......
......@@ -198,10 +198,9 @@ define(function (require) {
tarShape.style.text = this._getLabelText(
serie, data, name, 'normal'
);
tarShape.style.textPosition =
typeof nLabel.position == 'undefined'
? (orient == 'horizontal' ? 'right' : 'top')
: nLabel.position;
tarShape.style.textPosition = typeof nLabel.position == 'undefined'
? (orient == 'horizontal' ? 'right' : 'top')
: nLabel.position;
tarShape.style.textColor = nTextStyle.color;
tarShape.style.textFont = this.getFont(nTextStyle);
}
......@@ -481,11 +480,9 @@ define(function (require) {
}
else {
// 大规模MarkPoint
pList.push(
this.getLargeMarkPoingShape(serie, seriesIndex, mpOption, component)
);
itemShape = this.getLargeMarkPoingShape(serie, seriesIndex, mpOption, component);
itemShape && pList.push(itemShape);
}
//console.log(pList);
return pList;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册