100pah commented on a change in pull request #10766: pie/funnel legend can use
visualMap color.
URL:
https://github.com/apache/incubator-echarts/pull/10766#discussion_r339461589
##########
File path: src/component/legend/LegendView.js
##########
@@ -191,10 +191,15 @@ export default echarts.extendComponentView({
}
if (seriesModel.legendDataProvider) {
- var data = seriesModel.legendDataProvider();
+ // pie/funnel legend can use visualMap color.
+ var data =
seriesModel.getData();
var idx = data.indexOfName(name);
if (idx < 0) {
- return;
+ var rawData =
seriesModel.legendDataProvider();
+ idx = rawData.indexOfName(name);
+ if (idx < 0) {
+ return;
+ }
}
Review comment:
> leak the implementation of legend component to the series
I think it probably OK about that, now that the name is `legendDataProvider`.
The original way is:
series give a "data" to legend, and then legend retrieve what
it wants from the "data".
But now the problem we meet is that legend can not retrieve some
attr from the data (e.g., can not retrieve `color` and `borderColor`). So
series
need to provide more ways for legend to make sure it can retrieve them. That
probably has made the fact that: series knows that legend need `color` and
`borderColor`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]