Chart Legend

Des pastilles de couleur et une légende de graphique dont les éléments peuvent afficher ou masquer les séries.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Utilisation

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

Importation

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

Référence de l’API

SoneChartLegendComponentComposant

`<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.

Sélecteur
sone-chart-legend
Inputs
NomType Par défaut
itemsreadonly SoneChartLegendItem[][]
orientationSoneChartLegendOrientation"row"
toggleablebooleanfalse
hiddenbidirectionnel

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
Outputs
NomType
toggle

The key of the item the user toggled.

string

SoneSwatchDirectiveDirective

`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`.

Sélecteur
span[soneSwatch]
Inputs
NomType Par défaut
tonestring | null | undefined""
shapeSoneSwatchShape"dot"