mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: pie chart add label
This commit is contained in:
@@ -24,6 +24,10 @@ export class Pie extends BaseG2Chart {
|
||||
.encode('y', y[0].value)
|
||||
.encode('color', series[0].value)
|
||||
.legend('color', { position: 'bottom', layout: { justifyContent: 'center' } })
|
||||
.label({
|
||||
position: 'outside',
|
||||
text: (data: any) => `${data[series[0].value]}: ${data[y[0].value]}`,
|
||||
})
|
||||
.tooltip((data) => {
|
||||
return { name: y[0].name, value: data[y[0].value] }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user