import { areaY, colorLegend, colorLegendItems, defineChart, ruleY } from "@tanstack/charts"
import { scaleLinear } from "@tanstack/charts/scales/linear"
import { scalePoint } from "@tanstack/charts/scales/point"
import { tooltip } from "@tanstack/charts/tooltip"
import { Chart, chartColors, seriesTooltip } from "@/components/ui/tanstack-chart"
{ month: "Jan", industry: "Retail", unemployed: 1240 },
{ month: "Jan", industry: "Manufacturing", unemployed: 980 },
{ month: "Feb", industry: "Retail", unemployed: 1310 },
{ month: "Feb", industry: "Manufacturing", unemployed: 1020 },
{ month: "Mar", industry: "Retail", unemployed: 1190 },
{ month: "Mar", industry: "Manufacturing", unemployed: 940 },
const definition = defineChart(
ruleY([0], { stroke: chartColors.axis }),
x: { scale: scalePoint },
y: { scale: scaleLinear, grid: true, axis: { label: "Unemployed (thousands)" } },
range: [...chartColors.series],
legend: colorLegend({ label: "Industry", items: colorLegendItems({ gap: 16 }) }),
{ focus: "group-x", tooltip: { use: tooltip, content: seriesTooltip } },
export function UnemploymentChart() {
ariaLabel="Unemployed workers by industry, stacked"