Area Chart
Séries desenhadas como áreas preenchidas, sobrepostas ou empilhadas, com o eixo, a legenda, o tooltip, o foco itinerante e a tabela de dados oculta do gráfico de linhas.
Angular: disponível Vue: disponível React: disponível React Native: disponível
Uso
- Mobile
- Desktop
| Month | Mobile | Desktop |
|---|---|---|
| Jan | 80 | 186 |
| Feb | 200 | 305 |
| Mar | 120 | 237 |
| Apr | 190 | 73 |
| May | 130 | 209 |
| Jun | 140 | 214 |
<div class="demo-stack" style="padding-top: var(--space-4)">
<sone-area-chart
[data]="visitors"
[series]="series"
xKey="month"
curve="smooth"
stacked
ariaLabel="Visitors, January to June 2026"
categoryHeader="Month"
/>
</div>Importação
import {
SoneAreaChartComponent,
} from "@surface-one/angular/area-chart";Referência da API
SoneAreaChartComponentComponente
`<sone-area-chart>` — series drawn as filled areas (shadcn/ui Area Chart): a `<sone-line-chart area>` with the same data, axis, legend, tooltip, roving focus and hidden data table. `stacked` piles the series on one another, each filling down to the one below; otherwise every area fills down to zero.
| Nome | Tipo | Padrão |
|---|---|---|
dataThe rows, left to right: each holds the x value (`xKey`) and one value per series. | readonly T[] | [] |
seriesThe series: `{ key, label, tone }`, `key` naming the row property of its values. | readonly SoneLineChartSeries[] | [] |
xKeyThe row property of the x value. | string | "x" |
xScale`category` — evenly spaced; `time` — spaced by date (`Date`, epoch ms or ISO string). | SoneLineChartXScale | "category" |
xFormatThe label of an x value (axis, tooltip, table); default: the text, or a short date. | SoneLineChartXFormat | null | null |
xTicksAt most this many x-axis labels (stepped back from the last one); 0 hides the axis. | number | 6 |
yTicksAbout this many value-axis steps. | number | 4 |
yMinThe bottom of the value axis; default: 0, or the lowest value when negative. | number | null | null |
yMaxThe top of the value axis; default: a round step above the highest (stacked) value. | number | null | null |
heightThe plot height in CSS pixels (the x labels sit below it). | number | 200 |
curve`linear` — straight segments; `smooth` — a monotone curve. | SoneLineChartCurve | "linear" |
stackedStacks the series, each filling down to the one below. | boolean | false |
dotsDraws a dot on every value (the hovered or focused x value always shows its dots). | boolean | false |
legendShows the legend under the plot. | boolean | true |
ariaLabelNames the chart and captions its data table. | string | "" |
valueFormatFormats values on the axis, in the tooltip and in the data table. | SoneLineChartFormat | defaultFormat |
categoryHeaderThe data table's category column header. | — | $localize`Category` |