mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
feat(console): update dashboard chart y-axis tick format (#1590)
This commit is contained in:
parent
b04be8ada5
commit
951c6fa9a5
1 changed files with 7 additions and 2 deletions
|
@ -29,6 +29,11 @@ const tickStyle = {
|
|||
fontFamily: 'var(--font-family)',
|
||||
};
|
||||
|
||||
const tickFormatter = new Intl.NumberFormat('en-US', {
|
||||
maximumFractionDigits: 1,
|
||||
notation: 'compact',
|
||||
});
|
||||
|
||||
const Dashboard = () => {
|
||||
const [date, setDate] = useState<string>(dayjs().format('YYYY-MM-DD'));
|
||||
const { data: totalData, error: totalError } = useSWR<TotalUsersResponse, RequestError>(
|
||||
|
@ -111,11 +116,11 @@ const Dashboard = () => {
|
|||
/>
|
||||
<XAxis dataKey="date" tickLine={false} tick={tickStyle} />
|
||||
<YAxis
|
||||
orientation="right"
|
||||
width={30}
|
||||
width={35}
|
||||
axisLine={false}
|
||||
tickLine={false}
|
||||
tick={tickStyle}
|
||||
tickFormatter={(tick) => tickFormatter.format(tick).toLowerCase()}
|
||||
/>
|
||||
<Tooltip content={<ChartTooltip />} cursor={{ stroke: 'var(--color-primary' }} />
|
||||
</AreaChart>
|
||||
|
|
Loading…
Reference in a new issue