mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: fix pie chart display showing incorrect visual proportions
This commit is contained in:
@@ -30,16 +30,24 @@ export class Pie extends BaseG2Chart {
|
||||
y: y[0].value,
|
||||
color: series[0].value,
|
||||
},
|
||||
scale: {
|
||||
x: {
|
||||
nice: true,
|
||||
},
|
||||
y: {
|
||||
type: 'linear',
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
color: { position: 'bottom', layout: { justifyContent: 'center' } },
|
||||
},
|
||||
animate: { enter: { type: 'waveIn' } },
|
||||
labels: [
|
||||
{
|
||||
position: 'outside',
|
||||
position: 'spider',
|
||||
text: (data: any) => {
|
||||
return `${data[series[0].value]}: ${data[y[0].value]}${_data.isPercent ? '%' : ''}`
|
||||
},
|
||||
transform: [{ type: 'exceedAdjust' }, { type: 'overlapHide' }],
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
|
||||
@@ -21,18 +21,22 @@ function getPieOptions(baseOptions, axis, data) {
|
||||
y: y[0].value,
|
||||
color: series[0].value,
|
||||
},
|
||||
scale: {
|
||||
x: {
|
||||
nice: true,
|
||||
},
|
||||
y: {
|
||||
type: 'linear',
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
color: {position: 'bottom', layout: {justifyContent: 'center'}},
|
||||
},
|
||||
labels: [
|
||||
{
|
||||
position: 'outside',
|
||||
position: 'spider',
|
||||
text: (data) =>
|
||||
`${data[series[0].value]}: ${data[y[0].value]}${_data.isPercent ? '%' : ''}`,
|
||||
transform: [
|
||||
{ type: 'exceedAdjust' },
|
||||
{ type: 'overlapHide' },
|
||||
],
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
|
||||
Reference in New Issue
Block a user