Chart Legend

Próbki kolorów i legenda wykresu, której pozycje mogą włączać i wyłączać serie.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

  • Playback4.2 GB
  • Masters2.8 GB
  • Locked640 MB
Me Others Trend

Import

ts
import {
  SoneChartLegendComponent,
  SoneSwatchDirective,
} from "@surface-one/angular/chart-legend";

Dokumentacja API

SoneChartLegendComponentKomponent

`<sone-chart-legend>` — the key of a chart: a swatch, a label and an optional value per series. `toggleable` turns every item into a toggle button (`aria-pressed` = the series is shown) that updates `hidden` (two-way) and emits `toggle` with the item's key.

Selektor
sone-chart-legend
Wejścia
NazwaTyp Domyślnie
itemsreadonly SoneChartLegendItem[][]
orientationSoneChartLegendOrientation"row"
toggleablebooleanfalse
hiddendwukierunkowe

Keys of the series that are switched off.

readonly string[][]
shapeSoneSwatchShape"dot"
ariaLabel

Names the list (e.g. "Series"); optional.

string | nullnull
locale

Locale for numeric values; defaults to the active `$localize` locale.

string | nullnull
Wyjścia
NazwaTyp
toggle

The key of the item the user toggled.

string

SoneSwatchDirectiveDyrektywa

`span[soneSwatch]` — the colour key of a series: a dot, a square or a short line. Decorative (`aria-hidden`); the text next to it carries the meaning. `tone` is a token suffix (`chart-3`, `graph-note`, `success`), a custom property name (`--brand`) or any CSS colour; empty uses `currentColor`. Size it with `--swatch-size`.

Selektor
span[soneSwatch]
Wejścia
NazwaTyp Domyślnie
tonestring | null | undefined""
shapeSoneSwatchShape"dot"