-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Changing series type through setOption does not take effect #19349
Comments
As a worksround you can reapply the data property in |
Ah great, thanks @MatthiasMert ! |
Actually this won't work, as our users don't have access to the |
@hughess, add |
Here's the situation I'm trying to solve: Our users will use one of our chart components, like this: <LineChart
data={query}
x=month
y=sales
/> And this new option will let them override the config for echarts like so: <LineChart
data={query}
x=month
y=sales
echartsOptions={{
series: [
{type: 'bar'}
]
}}
/> In the background, I am taking the If the user includes <LineChart
data={query}
x=month
y=sales
echartsOptions={{
series: [
{type: 'bar', data: option.series.data[0]}
]
}}
/> |
not-a-bug |
Why does |
Why should the user include |
I don't think the user should include |
Version
5.4.3
Link to Minimal Reproduction
https://codesandbox.io/s/stacked-horizontal-bar-forked-f7dss4?file=/index.js
Steps to Reproduce
bar
toline
)Current Behavior
When you change attributes of the series, the chart works as expected (e..g, change colour from green to purple).
When you change the series type, the series disappears from the chart. The legend is updated with the correct series type, but the actual chart data is not visible.
Expected Behavior
Should be able to change the series type in the same way you can change the other attributes. Experience should be the same as changing the series type in any of the echarts example pages. E.g., if you go here and change one of these bar series to
line
it will still work: https://echarts.apache.org/examples/en/editor.html?c=bar-y-category-stackBut if you do the same through a second call to
setOption
, it will not workEnvironment
Any additional comments?
I am giving our users a way to override the settings of our chart components by accessing the raw ECharts configuration. I think changing the series type will be a common request. Originally, I was planning to manually merge the settings objects, but was very happy to get it working by letting the user pass their incremental settings to
setOption
The text was updated successfully, but these errors were encountered: