apache / apache/echarts

[Bug] "DEPRECATED: "api.style" has been deprecated"

Open
#16,514 6 comments 2 reactions 0 assignees View on GitHub
bug en pending waiting-for: community
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### Version

5.2.2

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap

### Steps to Reproduce

1. Open https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap

### Current Behavior

An option from the doc is deprecated

### Expected Behavior

The options from the docs shouldn't be deprecated

### Environment

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

### Any additional comments?

I am using this echarts from example in my app : https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap
However, I have this warn in the console : `styleCompat.js:238 [ECharts] DEPRECATED: "api.style" has been deprecated. Please write literal style directly instead.`
I tried to find more about it and I could only find a bit of info in the Echarts changelog `In renderItem, the api.style(...) and api.styleEmphasis(...) are deprecated. Because it is not really necessary and hard to ensure backward compatibility. Users can fetch system designated visual by api.visual(...).`
Though, I couldn't find more and the doc still make the use of `api.style()` : https://echarts.apache.org/en/option.html#series-custom.renderItem.return

What should I change in the example above to make it works without deprecacted options ?

Contributor guide

Open the contributing guide

Research direction

Start with the linked custom-polar-heatmap reproduction and compare its renderItem usage with the renderItem return documentation linked in the issue. Locate the example and documentation source that produce the warning, then verify that the example works without the deprecated option and no longer logs the deprecation message.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.