[Bug] In some cases, custom legends do not work
Version
5.3.3
Link to Minimal Reproduction
https://codesandbox.io/s/hopeful-payne-3kyvgp
Steps to Reproduce
select the line or mixed chart -> the legends functional correctly, but in the area doesn't have any effect.
I didn't understand from the docs if I have access to the legends inner state, I want to be able to get an object that represents the inner state of the legends, after I set the chart configuration, something like:
{ Alpha: true, Beta: false }
is it possible?
Current Behavior
I set the name property of each series, when the user clicks on one of the custom legends, I fire the event with the name of that legend, it works in some charts.
Expected Behavior
I expect to be able to toggle legends by name on all charts
Environment
OS: macOS Monterey
Browser: Chrome 104.0.5112.79
Framework React@18
Any additional comments?
thank you you're awesome
emmm.... review your code.
I found these differences.
| three charts | default config |
|---|---|
![]() |
![]() |
Area did't configure legend: {show: false}
so, are you clear now?
emmm.... review your code.
I found these differences.
three charts default config
![]()
Area did't configure
legend: {show: false}so, are you clear now?
sorry, I don't understand how your answer is related to my issue, can you please explain yourself?
I'm using legend: {show: false} as the default configuration since I want to be able to render custom legends. i don't want Echarts to render the legends
so how i can get the legends list and their state?
thanks
If you customize legend, you also need to add legend and set it to not display, same with line chart.
legend: {show: false}

