---
title: "ChartLegend"
description: "Interactive, keyboard-navigable."
canonical: "https://lopifi.com/components/chart-legend"
---

# ChartLegend

> Interactive, keyboard-navigable.

Source: https://lopifi.com/components/chart-legend
Part of: Lopifi — Your VC tech stack partner (https://lopifi.com)

---

- **Family:** Dashboard & charts — 
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/dashboard-charts

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/chart-legend
```

## Specification

Interactive: click to isolate a series, keyboard-navigable, `aria-pressed` state. Positioned below on phone as a wrapping row. Series colors are assigned by a **stable key hash**, never by array index, so a category is the same color in the dashboard and the drill-down.

## Rules this component obeys

Money is minor units, never floats. `null` is not `0` and neither is redacted. Negatives render in accounting parentheses with the parenthesis column reserved on both sides. Debit and credit are two columns. Per-currency decimal places. Polarity is explicit — up is not always good. Every figure states its period, entity, currency, basis and as-of.
