@@ -29,7 +29,7 @@ import { useEffect, useMemo, useState } from 'react';
2929 * from the `GET /v0/management/concurrency?timeRange=...` endpoint.
3030 */
3131import { api , UsageData , PieChartDataPoint , type ConcurrencyData } from '../../../lib/api' ;
32- import { formatNumber , formatTokens } from '../../../lib/format' ;
32+ import { formatNumber , formatTokens , formatTimeLabel , formatDateTimeLabel } from '../../../lib/format' ;
3333import { Card } from '../../ui/Card' ;
3434import { TotalEnergyComparison } from '../../TotalEnergyComparison' ;
3535import { TimeRangeSelector } from '../TimeRangeSelector' ;
@@ -432,14 +432,15 @@ export const UsageTab: React.FC<UsageTabProps> = ({
432432 < ResponsiveContainer width = "100%" height = "100%" >
433433 < AreaChart data = { data } >
434434 < CartesianGrid strokeDasharray = "3 3" stroke = "var(--color-border-glass)" />
435- < XAxis dataKey = "timestamp" stroke = "var(--color-text-secondary)" />
435+ < XAxis dataKey = "timestamp" stroke = "var(--color-text-secondary)" tickFormatter = { ( v ) => formatTimeLabel ( String ( v ) ) } />
436436 < YAxis stroke = "var(--color-text-secondary)" tickFormatter = { formatNumber } />
437437 < Tooltip
438438 contentStyle = { {
439439 backgroundColor : 'var(--color-bg-card)' ,
440440 borderColor : 'var(--color-border)' ,
441441 color : 'var(--color-text)' ,
442442 } }
443+ labelFormatter = { ( label ) => formatDateTimeLabel ( String ( label ) ) }
443444 formatter = { ( value ) => formatNumber ( value as number ) }
444445 />
445446 < Area
@@ -576,14 +577,15 @@ export const UsageTab: React.FC<UsageTabProps> = ({
576577 < ResponsiveContainer width = "100%" height = "100%" >
577578 < AreaChart data = { data } >
578579 < CartesianGrid strokeDasharray = "3 3" stroke = "var(--color-border-glass)" />
579- < XAxis dataKey = "timestamp" stroke = "var(--color-text-secondary)" />
580+ < XAxis dataKey = "timestamp" stroke = "var(--color-text-secondary)" tickFormatter = { ( v ) => formatTimeLabel ( String ( v ) ) } />
580581 < YAxis stroke = "var(--color-text-secondary)" tickFormatter = { formatTokens } />
581582 < Tooltip
582583 contentStyle = { {
583584 backgroundColor : 'var(--color-bg-card)' ,
584585 borderColor : 'var(--color-border)' ,
585586 color : 'var(--color-text)' ,
586587 } }
588+ labelFormatter = { ( label ) => formatDateTimeLabel ( String ( label ) ) }
587589 formatter = { ( value ) => formatTokens ( value as number ) }
588590 />
589591 < Legend />
0 commit comments