feat: charts css

This commit is contained in:
ulleo
2025-07-22 18:54:06 +08:00
parent 9e3b139e73
commit 00a428054d
2 changed files with 48 additions and 4 deletions
@@ -32,8 +32,30 @@ export class Bar extends BaseG2Chart {
color: series.length > 0 ? series[0].value : undefined,
},
style: {
radiusTopLeft: 4,
radiusTopRight: 4,
radiusTopLeft: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] > 0) {
return 4
}
return 0
},
radiusTopRight: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] > 0) {
return 4
}
return 0
},
radiusBottomLeft: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] < 0) {
return 4
}
return 0
},
radiusBottomRight: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] < 0) {
return 4
}
return 0
},
},
axis: {
x: {
@@ -31,8 +31,30 @@ export class Column extends BaseG2Chart {
color: series.length > 0 ? series[0].value : undefined,
},
style: {
radiusTopLeft: 4,
radiusTopRight: 4,
radiusTopLeft: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] > 0) {
return 4
}
return 0
},
radiusTopRight: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] > 0) {
return 4
}
return 0
},
radiusBottomLeft: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] < 0) {
return 4
}
return 0
},
radiusBottomRight: (d: ChartData) => {
if (d[y[0].value] && d[y[0].value] < 0) {
return 4
}
return 0
},
},
axis: {
x: {