apache / apache/echarts

[Bug] 着色地图在没有匹配项时,地图会出现背景蓝色

Open
#20,892 5 comments 0 reactions 0 assignees View on GitHub
bug pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.6.0

### Link to Minimal Reproduction

no

### Steps to Reproduce

下图是ECharts5.6作图生成的着色地图,当我数据源没有对应的省份时,会出现蓝色,
![Image](https://github.com/user-attachments/assets/66cc2c11-c6ea-4e29-bdcb-c116363d1608)

在之前530的版本里,是正常的,如下图所示:

![Image](https://github.com/user-attachments/assets/8d3c4137-abf6-44d6-b9f5-41d4ccfaaff0)

以下是option的配置项:
`var option ={
"isEnableChangeProject": true,
"projection": null,
"chartType": "ECharts",
"chartWidth": 750,
"chartHeight": 500,
"isFullScreen": false,
"isSvgRender": true,
"backgroundColor": "transparent",
"title": {
"text": ""
},
"toolbox": {
"show": false,
"right": 20,
"feature": {
"saveAsImage": {
"type": "png",
"title": "导出图片"
}
}
},
"dataset": {
"source": [
[
"省份",
"数值"
],
[
"台湾",
56.11
],
[
"河北",
16.12
],
[
"山西",
29.14
],
[
"内蒙古",
29.07
],
[
"辽宁",
14.66
],
[
"吉林",
18.28
],
[
"黑龙江",
17.86
],
[
"江苏",
11.39
],
[
"浙江",
96.88
]
]
},
"tooltip": {
"textStyle": {
"fontSize": 14.0
},
"trigger": "item",
"formatter": //startFunction
function(paras){ return'省份:'+paras.data[0] +'
'+
'数值:'+formatNumWithThousands(Number((paras.data[1]/1).toFixed(0)))}
//endFunction
},
"series": [
{
"name": "系列",
"type": "map",
"roam": true,
"map": "china",
"labelLayout": {
"hideOverlap": true
},
"label": {
"show": true,
"fontSize": 12.0,
"formatter": //startFunction
function (paras) {
if (paras.data != null) {
return paras.data[0] != null ? paras.data[0] : "";
}
}
//endFunction
}
}
],
"visualMap": {
"show": true,
"orient": "vertical",
"left": "10%",
"bottom": "10%",
"precision": 0.0,
"itemHeight": 140.0,
"align": "left",
"type": "continuous",
"min": 11.39,
"max": 96.88,
"realtime": true,
"calculable": true,
"inRange": {
"color": [
"#FFFFD9",
"#EDF8B1",
"#C7E9B4",
"#7FCDBB",
"#41B6C4",
"#1D91C0",
"#225EA8"
]
},
"textStyle": {
"fontSize": 14
},
"splitNumber": 7,
"text": [
"高",
"低"
]
}
};`

### Current Behavior

ECharts5.6会渲染出没有dataset.source上和地图geojson没有节点,显示为NAN,地图底图颜色为蓝色

### Expected Behavior

应该像之前的版本那样,匹配不上的,不应该有该形状出现在地图图层里,直接显示地图底图的配置底色就可以。在旧版本里,工具提示移到这些不存在的区域时不会有提示,新版会提示NAN

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.