🐛 Bug description [Please make everyone to understand it]
Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction.
📷 Step to reproduce
Insert the following code after line 17
.legend('color', {
itemLabelText: d => {
console.log(d);
return String(d.label).toUpperCase();
},
})
In the console, it shows that the callback is invoked twice where:
- The first time with string arguments
- The second time with object arguments
And it seems that only the computation result for the second time will be used to display the legend label text.
🏞 Expected result
This behavior was not documented in the doc, and while debugging, only the first string argument is instantly visible to developers, which is error prone and can cause the plot crash.
🚑 Any additional [like screenshots]
- G2Plot Version:
- Platform: