What problem does this feature solve?
We would love to customise on legend as a react component, so that we can apply some customer styling on each different section of the name
in legend.
What does the proposed API look like?
Something like
{
legend: {formatter: (value) => <div>value</div>}
}
3条答案
按热度按时间qf9go6mv1#
Unlike the
tooltip
component, thelegend
component doesn't support rendering via HTML elements.cgh8pdjw2#
Hey @plainheart
Yea. I knew that. I am just wondering. Would it be possible to have that in the future just like the tooltip is having?
evrscar23#
@lianfengluo Hi, I don't think this is quite possible. A better way is not to use legend of ECharts but render it using react and call setOption when user clicks the dom.