apache / apache/echarts

[Bug] Error in "map" chart with seriesLayoutBy: 'row'

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

Description

### Version

6.0.0

### Link to Minimal Reproduction

option code provided in the body

### Steps to Reproduce

The following option properly renders as a map of Iceland with a numeric dataset displayed on mouse over each region:

```javascript
var opt = {
tooltip: {
trigger: 'item',
},
dataset: {
source: [
['L0', 'val'],
['Austurland', 1000],
['Suðurland', 256],
['Norðurland vestra', 489],
['Norðurland eystra', 51]
]
},
geo: {
map: 'iceland',
aspectScale: 0.42261826174069944,
label: {
show: true,
position: 'inside'
}
},
series: [
{
name: 'val',
encode: {
value: 1,
itemName: 0,
},
seriesLayoutBy: 'column',
coordinateSystem: 'geo',
geoIndex: 0,
type: 'map'
},
]
}
```
Same option, but changing the dataset layout to row-based and setting `seriesLayoutBy: 'row'` results in an error shown in the next section.
```javascript
var opt = {
tooltip: {
trigger: 'item',
},
dataset: {
source: [
['L0','Austurland','Suðurland','Norðurland vestra','Norðurland eystra'],
['val',1000,256,489,51]
]
},
geo: {
map: 'iceland',
aspectScale: 0.42261826174069944,
label: {
show: true,
position: 'inside'
}
},
series: [
{
name: 'val',
encode: {
value: 1,
itemName: 0,
},
seriesLayoutBy: 'row',
coordinateSystem: 'geo',
geoIndex: 0,
type: 'map'
},
]
}
```

### Current Behavior

This error for the "row" layout

Image

### Expected Behavior

No error should be thrown, the map of Iceland should display, mouse over the country regions should display dataset numbers.

### Environment

```markdown
- OS: MacOS
- Browser: agnostic, e.g., Firefox 148 or Chrome 145.0.7632.117
- Framework: N/A
```

### 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.