G2Plot
G2Plot copied to clipboard
🥰 [FEATURE] Allow data label style to be a function (same as for data points)
🥰 Features description [Please make everyone to understand it]
Allow data label style to be a function (same as for data points).
🏞 What problem does this feature solve
So it would be possible to use different colors for different categories.
🧐 What does the proposed API look like
label.style: (item) => {
if (item.category === 'Gas fuel') {
return {fill: 'red'};
}
return {fill: 'green'};
},