style: user usage rank

This commit is contained in:
jialin
2026-01-06 17:21:32 +08:00
parent c821a2e463
commit b2f5eb8850
+15 -13
View File
@@ -55,17 +55,18 @@ const BarChart: React.FC<ChartProps & { maxItems?: number }> = (props) => {
show: true, show: true,
overflow: 'truncate', overflow: 'truncate',
width: 75, width: 75,
ellipsis: '...' ellipsis: '...',
// formatter(value: string, index: number) { margin: 12,
// return `{a|${index + 1}}`; formatter(value: string, index: number) {
// }, return `{a|${index + 1}}`;
// rich: { },
// a: { rich: {
// fontWeight: 500, a: {
// fontSize: 14, fontWeight: 500,
// color: token?.colorTextSecondary fontSize: 14,
// } color: token?.colorTextSecondary
// } }
}
} }
}, },
legend: { legend: {
@@ -81,9 +82,9 @@ const BarChart: React.FC<ChartProps & { maxItems?: number }> = (props) => {
type: 'bar', type: 'bar',
barWidth: 20, barWidth: 20,
stack: 'Ad', stack: 'Ad',
barGap: '30%', barGap: '20%',
label: { label: {
show: false, show: true,
formatter(params: any) { formatter(params: any) {
if (params.seriesIndex === 0) { if (params.seriesIndex === 0) {
return `{value|${params.name}}`; return `{value|${params.name}}`;
@@ -172,6 +173,7 @@ const BarChart: React.FC<ChartProps & { maxItems?: number }> = (props) => {
) : ( ) : (
<Chart <Chart
height={height} height={height}
chartHeight={typeof height === 'number' ? height - 10 : undefined}
options={dataOptions} options={dataOptions}
width={width || '100%'} width={width || '100%'}
></Chart> ></Chart>