new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

shadcn/ui · Components · all subjects

chart/props

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

ChartConfig type definition

The ChartConfig type is imported from @/components/ui/chart. Each config key maps to an object with a label (human-readable string), optional icon (Lucide React icon component), and color (hex, hsl, oklch format or CSS variable). Color can alternatively be a theme object with 'light' and 'dark' keys for theme-specific colors.

ChartLegendContent nameKey prop

ChartLegendContent accepts a nameKey prop (string) to use a custom key for legend names. Colors are automatically referenced from the chart config.

Chart config structure and purpose

The chart config holds configuration for the chart including human-readable strings such as labels, icons and color tokens for theming. It is intentionally decoupled from chart data, allowing you to share config and color tokens between charts and work independently when data or color tokens live remotely or in different formats.

Chart config example with Monitor icon

Example chart config structure: const chartConfig = { desktop: { label: "Desktop", icon: Monitor, color: "#2563eb", theme: { light: "#2563eb", dark: "#dc2626" } } } satisfies ChartConfig. Colors can be hex like '#2563eb', hsl like 'hsl(220, 98%, 61%)', oklch, or CSS variables like 'var(--color-name)'. Theme can be an object with light and dark keys.

ChartTooltipContent props

ChartTooltipContent accepts the following props: labelKey (string) - The config or data key to use for the label; nameKey (string) - The config or data key to use for the name; indicator (dot, line, or dashed) - The indicator style for the tooltip; hideLabel (boolean) - Whether to hide the label; hideIndicator (boolean) - Whether to hide the indicator.

Chart color formats supported

Charts support color values in any color format: hex (#2563eb), hsl (hsl(220, 98%, 61%)), oklch (oklch(0.5 0.2 240)), or CSS variables (var(--chart-2)).

Give your agent this brain