Verified Commit b4ab59d3 authored by Sarthik Gupta's avatar Sarthik Gupta 👽
Browse files

fix: realigned router-bandwidth chart

parent 91907e55
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,6 +9,6 @@ export class RouterBandwidth extends APIInterface<
  GetRouterBandwidthSearchParams
> {
  protected getUrl(): string {
    return `api/router/bandwidth`;
    return `router/bandwidth`;
  }
}
+14 −6
Original line number Diff line number Diff line
@@ -8,7 +8,11 @@ import {
} from "@/components/ui/chart";
import { cn } from "@/lib/utils";
import { LineChart, Line, CartesianGrid, XAxis, YAxis } from "recharts";
import { formatCount, formatUnixTimestamp } from "@/lib/format_unit";
import {
  formatCount,
  formatISODate,
  formatISODateWithDay,
} from "@/lib/format_unit";
import type { GetRouterBandwidthResponse } from "@model/router/bandwidth";

interface Props {
@@ -33,21 +37,25 @@ export function RouterBandwidthChart(props: Props) {
      <LineChart accessibilityLayer data={props.data.bandwidthTrend}>
        <CartesianGrid vertical={false} />
        <YAxis
          domain={[0, "auto"]}
          tickLine={false}
          axisLine={false}
          tickFormatter={(tick) => formatCount(tick, 0)}
          tickFormatter={(v) => formatCount(v, 1)}
        />
        <XAxis
          dataKey="date"
          tickLine={false}
          axisLine={false}
          tickFormatter={formatUnixTimestamp}
          tickMargin={8}
          minTickGap={32}
          tickFormatter={formatISODate}
        />
        <ChartTooltip
          cursor={false}
          content={
            <ChartTooltipContent
              indicator="dashed"
              // labelFormatter={formatUnixTimestamp}
              labelFormatter={formatISODateWithDay}
              indicator="dot"
            />
          }
        />
@@ -55,7 +63,7 @@ export function RouterBandwidthChart(props: Props) {
          <Line
            key={key}
            dataKey={key}
            type="natural"
            type="monotone"
            stroke={value.color}
            strokeWidth={2}
            dot={false}