What problem does this feature solve?
dispatchAction
supports addressing series and data by name but not by id.
In the following excerpt from the documentation we can see it indexes and names of series and data, but not the id of any of series.
This seems to be the case for all dispatchAction
targets, including the legendToggleSelect
API which I want to use, that supports name
but not id
.
This is despite the fact that the documentation explicitly states the ID can be used to address the component via the API.
I deliberately do not want to give a name to my series because I do not want it visible in the legend. I want to control it separately via the API. Yet, I cannot address it via its ID, only by its name, even though giving it a name has side-effects.
What does the proposed API look like?
dispatchAction({
type: 'legendToggleSelect',
id: 'seriesId',
})
3条答案
按热度按时间ee7vknir1#
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that it containsa minimum reproducible demoand necessaryimagesto illustrate. Otherwise, our committers will ask you to do so.
You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe our mailing list .
Have a nice day! 🍵
yvgpqqbh2#
First, you may define the name of the series and it does not have to be in the legend if you don't want to. Just don't put it inside
legend.data
will do.If you wish to use id, most likely you have to specify the id in the series otherwise you may not know the default logic of series id (in fact, it looks like
"\u0000Series Name\u00000"
). So that won't be much difference if you specifyid
orseriesName
.I tried with
seriedId
and it does not work. I don't know why it is not supported by now. But if you still have this requirement, we can discuss it more.dgiusagp3#
Actually
legendToggleSelect
action is dispatched tolegend
component, not series. So thename
property should matchlegend.data
. And defaultlegend.data
comes fromseries.name
notseries.id