feat: charts

This commit is contained in:
archer
2023-07-17 11:04:27 +08:00
parent 246283ee1c
commit ed42bb6ce8
6 changed files with 34 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ const TokenUsage = ({ appId }: { appId: string }) => {
},
yAxis: {
type: 'value',
max: Math.max(...data.map((item) => item.total)),
splitNumber: 3,
min: 0
},
grid: {
@@ -145,7 +145,7 @@ const TokenUsage = ({ appId }: { appId: string }) => {
data: data.map((item) => item.total),
type: 'line',
showSymbol: true,
animationDuration: 300,
animationDuration: 1000,
animationEasingUpdate: 'linear',
areaStyle: {
color: map['blue'].backgroundColor

View File

@@ -1,5 +1,5 @@
import React, { useCallback, useState, useMemo } from 'react';
import { Box, Flex, Button, Grid, useTheme, BoxProps, IconButton } from '@chakra-ui/react';
import React, { useCallback, useState } from 'react';
import { Box, Flex, Button, Grid, useTheme, IconButton } from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { useUserStore } from '@/store/user';
@@ -12,10 +12,10 @@ import { AppSchema } from '@/types/mongoSchema';
import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon';
import TotalUsage from './Charts/TotalUsage';
const InfoModal = dynamic(() => import('./InfoModal'));
const TotalUsage = dynamic(() => import('./Charts/TotalUsage'), { ssr: false });
const AppEdit = dynamic(() => import('./edit'), { ssr: false });
const AppEdit = dynamic(() => import('./edit'), { ssr: true });
import styles from '../../list/index.module.scss';
const Settings = ({ appId }: { appId: string }) => {