apache / apache/echarts

[Bug] Axis type='category' is not auto retrieved from _dataset.source_

Open
#21,282 2 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

[Demo](https://echarts.apache.org/examples/en/editor.html?code=PTAEBMEsGcGMCcCmAHAhgO1gT1Jdv0AXReZJQ1QyAe32oDNRoTJFoA6cS1UDcCbs0Lto1AK7xYiAFAhQADwCC8mABosymKEJZkiALwByWJUQBzavCyHQigAoBJAFyhZYUKABEAYVMWrAhSgJvgARoi8YoTUoOTwrABuiPz08NQAtkwsbJzcoJaBqEIi4pKIntJcQfqgANrSHrUAjADsAJyqoIYAFpbM4RiGALqqDXVNAGwADJ09fYgD6MOjjQBMACzrswA2eMzJy2O1qy1NO3uIByNHGwDMs6JYi4drtzNdj8_Xa-sAHA_UJ6IQZDaRDADc0moyCotFANQA3mMqkVEIQXLUEa4PB4oOlEOhoDRCRjDAB3RCQMzdQiGWb0S7gZbYnGiCRSFwolkAX2-Ck00BcSJxoHQqHxLnJlOptLG3JWoA0KkFoGFOJ0eklJmI_msCo8YolXQZBzlCuY8TYQrGHg1iElcEoxHgdJthRFclgGXxRHyUW03S0u3QEWivFgVASpkKQjl0m54KAA)

### Steps to Reproduce

Comment out the marked line in the Demo to see the result.

### Current Behavior

API for [Axis.type](https://echarts.apache.org/en/option.html#xAxis.type) says that _"Category data can be auto retrieved from series.data or dataset.source"_.
While this is working for _series.data_, it is not happening for _dataset.source_ and the chart is seriously compromised.
This is important because only _dataset_ can have [transformations](https://echarts.apache.org/en/option.html#dataset.transform) and can be accessed by multiple series, _series.data_ cannot.

### Expected Behavior

_series.data_ and _dataset.source_ to be treated the same when auto-retrieving **category** data type

### Environment

```markdown

```

### Any additional comments?

When the two data columns are switched, dataset.source works ok, but series.data does not.

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.