Skip to content
Back to Components

bash
npm install @hua-labs/hua
tsx
import { TrendChart } from "@hua-labs/ui/advanced/dashboard";

With Area Fill

Multiple Series

Color Palettes

approval
settlement

Props

series*TrendSeries[]-Array of series data with label, data, color, and area options
categories*string[]-Labels for the x-axis categories
palette"approval" | "settlement" | "custom""approval"Color palette preset
heightnumber200Chart height in pixels
showLegendbooleantrueWhether to show the legend
showDotsbooleantrueWhether to show data points
showTooltipbooleanfalseWhether to show tooltips on hover

TrendSeries

label*string-Series label for legend
data*number[]-Array of data values
colorstring-Custom color (hex or CSS color)
areabooleanfalseWhether to fill the area under the line

BasicTrendChart.tsxtsx
import { TrendChart } from "@hua-labs/ui/advanced/dashboard";

export function BasicTrendChart() {
  return (
    <TrendChart
      series={[
        { label: "Approved", data: [10, 20, 15, 30, 25, 35, 40] },
        { label: "Rejected", data: [5, 10, 8, 15, 12, 18, 14] }
      ]}
      categories={["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}
      palette="approval"
    />
  );
}

With Area Fill

TrendChartWithArea.tsxtsx
import { TrendChart } from "@hua-labs/ui/advanced/dashboard";

export function TrendChartWithArea() {
  return (
    <TrendChart
      series={[
        {
          label: "Settlement",
          data: [100, 200, 150, 300, 250, 400, 350],
          area: true,
          color: "#6366f1"
        }
      ]}
      categories={["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"]}
      palette="settlement"
      showDots
      showTooltip
    />
  );
}