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_r339577761
##########
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:
OK, we can use the last solution.
```js
var index = provider.indexOfName(name);
var color = provider.getVisual(index, 'color');
var borderColor = provider.getVisual(index, '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]