-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(legend): legend of pie/funnel/radar can pick from visualMap encoded color #11737
Conversation
return; | ||
} | ||
|
||
var color = data.getItemVisual(idx, 'color'); | ||
var borderColor = data.getItemVisual(idx, 'borderColor'); | ||
var idx = provider.indexOfName(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provider.indexOfName
seems to have covered the functionality of provider.containName
.
Why we need provider.containName
and do the O(n) search twice?
test/legend-visualMapColor.html
Outdated
"01", | ||
"高档", | ||
61278, | ||
"61278.00" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to obfuscate the data in case some unexpected legal issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be
} | ||
} | ||
] | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add (or already have?) a test case like #2372 described (I know it is correct both before and after this change).
Like:
option = {
legend: {
},
series: {
type: 'pie',
itemStyle: {
color: function (params) {
var colorList = ['#ff3322', '#232211', '#aabbcc'];
return colorList[params.dataIndex];
}
},
data: [
{name: 'a', value: 1222},
{name: 'b', value: 2333},
{name: 'c', value: 3444},
]
}
};
More technique discussion can be seen in #10766 (review)