apache / apache/echarts

[Bug] Dataset treats array of array differently than array of object

Open
#18,216 3 comments 0 reactions 0 assignees View on GitHub
bug difficulty: easy en topic: dataset
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.4.1

### Link to Minimal Reproduction

https://codepen.io/tobibe/pen/VwBEjvr

### Steps to Reproduce

create a line-chart option with dataset array of arrays and the same data with array of objects and use in both the series-option seriesLayoutBy: 'row'

### Current Behavior

with dataset as array of objects, it seems to ignore the series-option seriesLayoutBy: 'row'

behaves right:
```
dataset: {
source: [
['product', '2015', '2016', '2017'],
['Matcha Latte', 43.3, 85.8, 93.7],
['Milk Tea', 83.1, 73.4, 55.1],
['Cheese Cocoa', 86.4, 65.2, 82.5],
['Walnut Brownie', 72.4, 53.9, 39.1]
]
},
```

behaves like without seriesLayoutBy: 'row':
```
dataset: {
dimensions: ['product', '2015', '2016', '2017'],
source: [
{ product: 'Matcha Latte', '2015': 43.3, '2016': 85.8, '2017': 93.7 },
{ product: 'Milk Tea', '2015': 83.1, '2016': 73.4, '2017': 55.1 },
{ product: 'Cheese Cocoa', '2015': 86.4, '2016': 65.2, '2017': 82.5 },
{ product: 'Walnut Brownie', '2015': 72.4, '2016': 53.9, '2017': 39.1 }
],
},
```

![image](https://user-images.githubusercontent.com/9305993/215776767-c8dd8ee2-8871-4209-bc13-1bdf42c15ff3.png)

### Expected Behavior

same behavior in dataset with array of array as array of object

### Environment

```markdown
- OS: Windows
- Browser: Firefox/Chrome
- Framework: Angular
```

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