fix: dashboard colors, users rank

This commit is contained in:
jialin
2026-05-12 19:01:11 +08:00
committed by jialin
parent 2527555945
commit 4e49c399d0
9 changed files with 82 additions and 88 deletions
+3 -2
View File
@@ -1,8 +1,8 @@
import useCoolColors from '@/hooks/use-cool-colors';
import { Chart } from '@gpustack/core-ui';
import { formatLargeNumber } from '@gpustack/core-ui/utils';
import { Empty, Spin, theme } from 'antd';
import React, { useMemo, useRef } from 'react';
import { generateCoolColors } from '../bar-chart';
export interface PieChartItem {
name: string;
@@ -30,11 +30,12 @@ const PieChart: React.FC<PieChartProps> = ({
}) => {
const { token } = theme.useToken();
const chartRef = useRef<{ chart: any } | null>(null);
const generateCoolColors = useCoolColors();
const colors = useMemo(() => {
const generatedColors = generateCoolColors(data.length + colorOffset);
return generatedColors.slice(colorOffset);
}, [colorOffset, data.length]);
}, [colorOffset, data.length, generateCoolColors]);
const options = useMemo(
() => ({