Version
5.2.2
Link to Minimal Reproduction
https://echarts.apache.org/examples/en/editor.html?c=custom-polar-heatmap
Steps to Reproduce
Current Behavior
An option from the doc is deprecated
Expected Behavior
The options from the docs shouldn't be deprecated
Environment
- 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 ?
4条答案
按热度按时间jc3wubiy1#
Yes the example can be changed to simpler:
vd8tlhqk2#
Thanks @pissang
I let you close this, as I don't know if the documentation / examples should be updated
pgx2nnw83#
@pissang I got a similar use case with custom render using
api.style()
. It seems thatapi.style()
does more than just setting the styles.When I print out the result of
api.style()
, it's more than just styling. There are setting of the Y value, right?7z5jn7bk4#
Yes the example can be changed to simpler:
What should be used instead of api.styleEmphasis()?