@nanahoshi/mona-ui 0.26.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,462 @@
1
+ # Line & Area
2
+
3
+ > Line, area and range area series for values that change across a continuous or category axis.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/chart`
6
+
7
+ **Selectors:** `mona-line-series`, `mona-area-series`, `mona-range-area-series`
8
+
9
+ Line, area and range area series draw values that change along an X axis: over time, across categories or against a number. A line traces each value, an area fills down to the baseline or onto the series below it, and a range area fills the band between a low and a high value. They go inside a `mona-chart` with an X and a Y axis, and can share one chart with each other and with the other Cartesian series.
10
+
11
+ ## Overview
12
+
13
+ Pick the series by what the reader should compare.
14
+
15
+ | Series | Use it for | Reads |
16
+ | :--- | :--- | :--- |
17
+ | `mona-line-series` | Trends and comparisons across several series, where the shape of the change matters more than the amount. | `field` |
18
+ | `mona-area-series` | Volume over time, and the parts of a total when stacked. | `field` |
19
+ | `mona-range-area-series` | An interval at each X, such as a forecast's confidence band or a day's low and high. | `fromField`, `toField` |
20
+
21
+ **Use something else when:**
22
+
23
+ - The X values are unrelated categories with no order, such as products or regions. Bars compare them better, see [Bar & Waterfall](chart-bar.md).
24
+ - Each point stands alone and the order of the points means nothing. Use a scatter series, see [Scatter & Bubble](chart-scatter.md).
25
+ - You need the open, high, low and close of each period. Use a candlestick or OHLC series, see [Financial](chart-financial.md).
26
+
27
+ The chart, axes, legend, tooltip and interaction parts these series sit in are described on [Chart Overview](chart.md).
28
+
29
+ ## Import & Quick Start
30
+
31
+ ```typescript
32
+ import {
33
+ ChartComponent,
34
+ ChartLegendComponent,
35
+ ChartTooltipComponent,
36
+ ChartXAxisComponent,
37
+ ChartYAxisComponent,
38
+ LineSeriesComponent
39
+ } from "@nanahoshi/mona-ui/chart";
40
+ ```
41
+
42
+ ```html
43
+ <mona-chart aria-label="Monthly visitors" class="h-72 w-full" xField="month" [data]="visitors">
44
+ <mona-chart-x-axis />
45
+ <mona-chart-y-axis />
46
+ <mona-line-series field="web" name="Web" />
47
+ <mona-chart-legend />
48
+ <mona-chart-tooltip />
49
+ </mona-chart>
50
+ ```
51
+
52
+ Give the chart a height. It fills its host, and a host without a height has none.
53
+
54
+ ## Anatomy
55
+
56
+ Each series reads its rows from the chart's `data`, unless it has its own `data`. It takes the X value from the chart's `xField`, or from its own `xField`, and the Y value from `field`, or from `fromField` and `toField` for a range area. A field is a property name or an accessor, `(row, index) => value`.
57
+
58
+ | Input | Line | Area | Range area |
59
+ | :--- | :---: | :---: | :---: |
60
+ | `field` | ✓ | ✓ | |
61
+ | `fromField`, `toField` | | | ✓ |
62
+ | `curve`, `connectNulls`, `showPoints`, `pointRadius`, `strokeWidth` | ✓ | ✓ | ✓ |
63
+ | `lineStyle` | ✓ | ✓ | |
64
+ | `fillMode` | | ✓ | |
65
+ | `fillOpacity` | | ✓ | ✓ |
66
+ | `stack`, `stackMode` | | ✓ | |
67
+ | `dataLabels`, `downsampling`, `valueFormatter` | ✓ | ✓ | ✓ |
68
+
69
+ ### Templates
70
+
71
+ - `ng-template[monaChartDataLabel]`, inside a series, replaces the text of its data labels. The context is a `ChartDataLabelContext`, with `formattedValue`, `value`, `datum` and the stack values. Turn `dataLabels` on as well.
72
+ - The chart, axis, legend and tooltip templates are described on [Chart Overview](chart.md).
73
+
74
+ ## Examples
75
+
76
+ ### Line
77
+
78
+ Series read their values from the chart's `data`, using `field` for the value and the chart's `xField` for the category. `lineStyle` tells two series apart without relying on color.
79
+
80
+ `line-example.component.ts`
81
+
82
+ ```typescript
83
+ import { Component } from "@angular/core";
84
+ import {
85
+ ChartComponent,
86
+ ChartLegendComponent,
87
+ ChartXAxisComponent,
88
+ ChartYAxisComponent,
89
+ LineSeriesComponent
90
+ } from "@nanahoshi/mona-ui/chart";
91
+
92
+ @Component({
93
+ selector: "app-chart-line-area-line-example",
94
+ imports: [ChartComponent, ChartLegendComponent, ChartXAxisComponent, ChartYAxisComponent, LineSeriesComponent],
95
+ templateUrl: "./line-example.component.html"
96
+ })
97
+ export class ChartLineExampleComponent {
98
+ protected readonly visitors = [
99
+ { month: "Jan", mobile: 2100, web: 3200 },
100
+ { month: "Feb", mobile: 2400, web: 3100 },
101
+ { month: "Mar", mobile: 2900, web: 3500 },
102
+ { month: "Apr", mobile: 3300, web: 3400 },
103
+ { month: "May", mobile: 3800, web: 3700 },
104
+ { month: "Jun", mobile: 4200, web: 3600 }
105
+ ];
106
+ }
107
+ ```
108
+
109
+ `line-example.component.html`
110
+
111
+ ```html
112
+ <mona-chart aria-label="Monthly visitors by platform" class="h-72 w-full" xField="month" [data]="visitors">
113
+ <mona-chart-x-axis />
114
+ <mona-chart-y-axis title="Visitors" />
115
+ <mona-line-series curve="monotone-x" field="web" name="Web" [showPoints]="true" />
116
+ <mona-line-series curve="monotone-x" field="mobile" lineStyle="dashed" name="Mobile" [showPoints]="true" />
117
+ <mona-chart-legend position="bottom" />
118
+ </mona-chart>
119
+ ```
120
+
121
+ ### Stacked areas
122
+
123
+ Area series with the same `stack` name stack on top of each other, in the order they're declared. `stackMode="percent"` turns the totals into each series' share of 100%.
124
+
125
+ `stacked-area-example.component.ts`
126
+
127
+ ```typescript
128
+ import { Component, signal } from "@angular/core";
129
+ import {
130
+ AreaSeriesComponent,
131
+ ChartComponent,
132
+ ChartLegendComponent,
133
+ ChartTooltipComponent,
134
+ ChartXAxisComponent,
135
+ ChartYAxisComponent
136
+ } from "@nanahoshi/mona-ui/chart";
137
+ import type { ChartStackMode } from "@nanahoshi/mona-ui/chart";
138
+ import { SegmentedComponent } from "@nanahoshi/mona-ui/segmented";
139
+ import type { SegmentedOption } from "@nanahoshi/mona-ui/segmented";
140
+
141
+ @Component({
142
+ selector: "app-chart-line-area-stacked-area-example",
143
+ imports: [
144
+ AreaSeriesComponent,
145
+ ChartComponent,
146
+ ChartLegendComponent,
147
+ ChartTooltipComponent,
148
+ ChartXAxisComponent,
149
+ ChartYAxisComponent,
150
+ SegmentedComponent
151
+ ],
152
+ templateUrl: "./stacked-area-example.component.html"
153
+ })
154
+ export class ChartStackedAreaExampleComponent {
155
+ protected readonly mode = signal<ChartStackMode>("normal");
156
+ protected readonly modes: readonly SegmentedOption<ChartStackMode>[] = [
157
+ { label: "Totals", value: "normal" },
158
+ { label: "Share", value: "percent" }
159
+ ];
160
+ protected readonly traffic = [
161
+ { month: "Jan", direct: 1200, referral: 800, search: 2100 },
162
+ { month: "Feb", direct: 1350, referral: 760, search: 2300 },
163
+ { month: "Mar", direct: 1280, referral: 940, search: 2650 },
164
+ { month: "Apr", direct: 1500, referral: 1010, search: 2800 },
165
+ { month: "May", direct: 1620, referral: 1100, search: 3050 },
166
+ { month: "Jun", direct: 1580, referral: 1240, search: 3300 }
167
+ ];
168
+
169
+ protected onModeChange(mode: ChartStackMode | null): void {
170
+ if (mode) {
171
+ this.mode.set(mode);
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ `stacked-area-example.component.html`
178
+
179
+ ```html
180
+ <div class="flex w-full flex-col gap-3">
181
+ <mona-segmented
182
+ aria-label="Stack mode"
183
+ size="small"
184
+ [options]="modes"
185
+ [value]="mode()"
186
+ (valueChange)="onModeChange($event)"></mona-segmented>
187
+ <mona-chart aria-label="Visits by channel" class="h-72 w-full" xField="month" [data]="traffic">
188
+ <mona-chart-x-axis />
189
+ <mona-chart-y-axis />
190
+ <mona-area-series field="search" name="Search" stack="visits" [stackMode]="mode()" />
191
+ <mona-area-series field="direct" name="Direct" stack="visits" [stackMode]="mode()" />
192
+ <mona-area-series field="referral" name="Referral" stack="visits" [stackMode]="mode()" />
193
+ <mona-chart-legend />
194
+ <mona-chart-tooltip [shared]="true" />
195
+ </mona-chart>
196
+ </div>
197
+ ```
198
+
199
+ ### Range band
200
+
201
+ A range area fills between `fromField` and `toField`. Here it shows each month's range behind a line of the average, and `valueFormatter` adds the unit to the tooltip.
202
+
203
+ `range-band-example.component.ts`
204
+
205
+ ```typescript
206
+ import { Component } from "@angular/core";
207
+ import {
208
+ ChartComponent,
209
+ ChartLegendComponent,
210
+ ChartTooltipComponent,
211
+ ChartXAxisComponent,
212
+ ChartYAxisComponent,
213
+ LineSeriesComponent,
214
+ RangeAreaSeriesComponent
215
+ } from "@nanahoshi/mona-ui/chart";
216
+ import type { ChartValueFormatter } from "@nanahoshi/mona-ui/chart";
217
+
218
+ @Component({
219
+ selector: "app-chart-line-area-range-band-example",
220
+ imports: [
221
+ ChartComponent,
222
+ ChartLegendComponent,
223
+ ChartTooltipComponent,
224
+ ChartXAxisComponent,
225
+ ChartYAxisComponent,
226
+ LineSeriesComponent,
227
+ RangeAreaSeriesComponent
228
+ ],
229
+ templateUrl: "./range-band-example.component.html"
230
+ })
231
+ export class ChartRangeBandExampleComponent {
232
+ protected readonly temperatures = [
233
+ { average: 3, high: 7, low: -1, month: "Jan" },
234
+ { average: 4, high: 9, low: 0, month: "Feb" },
235
+ { average: 8, high: 13, low: 3, month: "Mar" },
236
+ { average: 12, high: 17, low: 6, month: "Apr" },
237
+ { average: 16, high: 21, low: 10, month: "May" },
238
+ { average: 19, high: 25, low: 13, month: "Jun" },
239
+ { average: 22, high: 28, low: 15, month: "Jul" },
240
+ { average: 21, high: 27, low: 15, month: "Aug" }
241
+ ];
242
+ protected readonly celsius: ChartValueFormatter = value => `${value} °C`;
243
+ }
244
+ ```
245
+
246
+ `range-band-example.component.html`
247
+
248
+ ```html
249
+ <mona-chart aria-label="Monthly temperatures" class="h-72 w-full" xField="month" [data]="temperatures">
250
+ <mona-chart-x-axis />
251
+ <mona-chart-y-axis title="°C" />
252
+ <mona-range-area-series
253
+ curve="monotone-x"
254
+ fromField="low"
255
+ name="Daily range"
256
+ toField="high"
257
+ [valueFormatter]="celsius" />
258
+ <mona-line-series curve="monotone-x" field="average" name="Average" [showPoints]="true" [valueFormatter]="celsius" />
259
+ <mona-chart-legend />
260
+ <mona-chart-tooltip [shared]="true" />
261
+ </mona-chart>
262
+ ```
263
+
264
+ ## Appearance & Styling
265
+
266
+ | Input | Values | Effect |
267
+ | :--- | :--- | :--- |
268
+ | `curve` | `"linear"`, `"monotone-x"`, `"natural"`, `"step"`, `"step-after"` | How the line goes between points. `monotone-x` is smooth and never overshoots a value, so it suits most data. `natural` is smoother but can swing past the points. `step` changes at each point, `step-after` just before the next. |
269
+ | `lineStyle` | `"solid"`, `"dashed"`, `"dotted"` | The stroke pattern. Use it for a forecast or a target, or to tell series apart in print and in forced colors. |
270
+ | `fillMode` | `"gradient"`, `"solid"` | A gradient fades to the baseline; a solid fill is even. Use solid for stacked areas, so the bands stay distinct. |
271
+ | `fillOpacity` | A number from `0` to `1` | The most opaque the fill gets. |
272
+ | `showPoints`, `pointRadius` | `boolean`, pixels | Markers at each value. They also help when few points are far apart. |
273
+ | `strokeWidth` | Pixels | The width of the line. |
274
+ | `color` | Any CSS color | Replaces the palette color. By default series take `--color-chart-1` to `--color-chart-5` in order. |
275
+
276
+ ## Behavior
277
+
278
+ ### Missing values
279
+
280
+ A row whose value is `null`, `undefined` or not a number leaves a gap. With `connectNulls`, the line or area goes straight across it instead. A range area needs both `fromField` and `toField`, and a row missing either one is a gap.
281
+
282
+ ### Stacking
283
+
284
+ - Area series stack when their `stack` names match after trimming, so several stacks can share one chart. Bar series stack the same way, see [Bar & Waterfall](chart-bar.md). Line and range area series don't stack.
285
+ - Every series in a stack needs the same `stackMode`. When they differ, or when the Y axis isn't `linear`, the group isn't stacked, and a development warning says why.
286
+ - A hidden series leaves its stack, and the series above it move down. With `stackMode="percent"` the shares are worked out again from the visible series.
287
+ - Stacked values, totals and percentages are in the tooltip and the data label context (`stackTotal`, `stackPercentage`).
288
+
289
+ ### Value formatting
290
+
291
+ `valueFormatter` formats a series' values in its tooltip, data labels and screen reader announcements, and leaves the axis ticks alone. To format ticks, use the axis `formatter`. Without either, numbers and dates follow the library locale.
292
+
293
+ ### Dense data
294
+
295
+ Line, unstacked area, stacked area and range area series on a continuous X axis (numbers or dates) reduce what they draw when they have more points than the plot has room for, and keep every point for hover, tooltips and selection. A series' `downsampling` overrides the chart's. The rules are on [Chart Overview](chart.md), under High-density downsampling. A category X axis is never reduced.
296
+
297
+ ### Two-way binding
298
+
299
+ `[(visible)]` holds whether the series is shown. The legend sets it when the user toggles the series.
300
+
301
+ ## Accessibility
302
+
303
+ The chart is the focusable element, and these series add no roles of their own. Each point is announced with its series name, X value and formatted value, so give each series a `name`, and use `valueFormatter` to add a unit the reader would otherwise miss.
304
+
305
+ - **Don't rely on color alone.** Use `lineStyle` or `showPoints` to tell series apart, and keep the legend.
306
+ - **Areas hide what's behind them.** Prefer stacking, or a lower `fillOpacity`, over overlapping unstacked areas.
307
+ - **Range areas announce both ends.** A point reads as its range, from the low to the high value.
308
+
309
+ ### Keyboard Navigation
310
+
311
+ | Key | Action |
312
+ | :--- | :--- |
313
+ | `ArrowRight` / `ArrowLeft` | Move to the next or previous X value. |
314
+ | `ArrowUp` / `ArrowDown` | Move to another series at the same X value. |
315
+ | `Home` / `End` | Move to the first or last X value. |
316
+
317
+ The rest of the keys, including selection, brushing and navigation, are listed on [Chart Overview](chart.md).
318
+
319
+ ## API
320
+
321
+ Everything below is imported from `@nanahoshi/mona-ui/chart`.
322
+
323
+ ### `AreaSeriesComponent`
324
+
325
+ Renders a continuous Cartesian area series supporting gradient fades, solid fills, cumulative stacking, and 100%
326
+ normalized bands.
327
+
328
+ **Selector:** `mona-area-series`
329
+
330
+ #### Inputs
331
+
332
+ | Name | Type | Default | Description |
333
+ | --- | --- | --- | --- |
334
+ | `class` | `string` | `""` | Additional CSS classes applied to the series host element. |
335
+ | `color` | `string` | `""` | Explicit stroke and fill color override for the area series. |
336
+ | `connectNulls` | `boolean` | `false` | Whether to connect points across null or invalid values without gaps. |
337
+ | `curve` | `ChartCurve` | `"linear"` | Curve interpolation style (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, or `"step-after"`). |
338
+ | `data` | `readonly unknown[] \| undefined` | `undefined` | Series-specific dataset overriding the root chart data. |
339
+ | `dataLabels` | `ChartDataLabelsInput` | `false` | Data label display options or boolean flag enabling default labels. |
340
+ | `downsampling` | `ChartDownsamplingInput \| undefined` | `undefined` | Per-series high-density downsampling override. Undefined inherits the chart policy. |
341
+ | `field` | `ChartField` | `""` | Property key or accessor extracting the Y value for each data item. |
342
+ | `fillMode` | `ChartAreaFillMode` | `"gradient"` | Area fill style (`"gradient"` fading to zero baseline, or uniform `"solid"`). |
343
+ | `fillOpacity` | `number \| undefined` | `undefined` | Maximum opacity applied to the area fill. |
344
+ | `keyField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting a stable datum identity across updates. |
345
+ | `lineStyle` | `ChartLineStyle` | `"solid"` | Stroke pattern used for the area's boundary line (`"solid"`, `"dashed"`, or `"dotted"`). |
346
+ | `name` | `string` | `""` | Name of the series displayed in legends and tooltips. |
347
+ | `pointRadius` | `number \| undefined` | `undefined` | Radius in pixels for point markers. |
348
+ | `seriesKey` | `string \| undefined` | `undefined` | Optional stable key identifying this series for mark identity and selection across updates. |
349
+ | `showPoints` | `boolean` | `false` | Whether to draw point markers at each data coordinate along the top boundary line. |
350
+ | `stack` | `string \| undefined` | `undefined` | Named stack group to participate in. Series with matching trimmed stack names stack together. |
351
+ | `stackMode` | `ChartStackMode` | `"normal"` | Stacking mode used when stack is specified: 'normal' for raw cumulative values, or 'percent' for 100% normalized segments. |
352
+ | `strokeWidth` | `number \| undefined` | `undefined` | Stroke width in pixels for the area boundary line. |
353
+ | `valueFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Custom formatter for raw Y/data values in tooltips and live region announcements. |
354
+ | `visible` (two-way) | `boolean` | `true` | Whether the series is currently visible on the chart and in calculations. |
355
+ | `xAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used. |
356
+ | `xField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting the X value, overriding the root chart X field. |
357
+ | `yAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian Y axis this series binds to. When omitted, the primary Y axis is used. |
358
+
359
+ #### Outputs
360
+
361
+ | Name | Type | Description |
362
+ | --- | --- | --- |
363
+ | `visibleChange` | `boolean` | Emitted when `visible` changes. |
364
+
365
+ ### `RangeAreaSeriesComponent`
366
+
367
+ Renders continuous Cartesian vertical range bands/areas bounded between lower and upper values (e.g. confidence
368
+ intervals, forecast envelopes, or high/low bands).
369
+
370
+ **Selector:** `mona-range-area-series`
371
+
372
+ #### Inputs
373
+
374
+ | Name | Type | Default | Description |
375
+ | --- | --- | --- | --- |
376
+ | `class` | `string` | `""` | Additional CSS classes applied to the series host element. |
377
+ | `color` | `string` | `""` | Explicit stroke and fill color override for the range area series. |
378
+ | `connectNulls` | `boolean` | `false` | Whether to connect points across null or invalid values without gaps. |
379
+ | `curve` | `ChartCurve` | `"linear"` | Curve interpolation style (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, or `"step-after"`). |
380
+ | `data` | `readonly unknown[] \| undefined` | `undefined` | Series-specific dataset overriding the root chart data. |
381
+ | `dataLabels` | `ChartDataLabelsInput` | `false` | Data label display options or boolean flag enabling default labels. |
382
+ | `downsampling` | `ChartDownsamplingInput \| undefined` | `undefined` | Per-series high-density downsampling override. Undefined inherits the chart policy. |
383
+ | `fillOpacity` | `number \| undefined` | `undefined` | Maximum opacity applied to the range area fill. |
384
+ | `fromField` (required) | `ChartField` | — | Property key or accessor extracting the starting range value for each data item. |
385
+ | `keyField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting a stable datum identity across updates. |
386
+ | `name` | `string` | `"Range Area"` | Name of the series displayed in legends, tooltips, and live region announcements. |
387
+ | `pointRadius` | `number \| undefined` | `undefined` | Radius in pixels for point markers drawn along the boundary curves. |
388
+ | `seriesKey` | `string \| undefined` | `undefined` | Optional stable key identifying this series for mark identity and selection across updates. |
389
+ | `showPoints` | `boolean` | `false` | Whether to draw point markers at each data coordinate along both boundary curves. |
390
+ | `strokeWidth` | `number \| undefined` | `undefined` | Stroke width in pixels for the boundary lines. |
391
+ | `toField` (required) | `ChartField` | — | Property key or accessor extracting the ending range value for each data item. |
392
+ | `valueFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Custom formatter for raw range values in tooltips and live region announcements. |
393
+ | `visible` (two-way) | `boolean` | `true` | Whether the series is currently visible on the chart and in calculations. |
394
+ | `xAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used. |
395
+ | `xField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting the X coordinate, overriding the root chart X field. |
396
+ | `yAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian Y axis this series binds to. When omitted, the primary Y axis is used. |
397
+
398
+ #### Outputs
399
+
400
+ | Name | Type | Description |
401
+ | --- | --- | --- |
402
+ | `visibleChange` | `boolean` | Emitted when `visible` changes. |
403
+
404
+ ### `LineSeriesComponent`
405
+
406
+ Renders a continuous Cartesian line series with configurable interpolation, optional null-gap joining, point markers,
407
+ data labels, and multi-axis binding.
408
+
409
+ **Selector:** `mona-line-series`
410
+
411
+ #### Inputs
412
+
413
+ | Name | Type | Default | Description |
414
+ | --- | --- | --- | --- |
415
+ | `class` | `string` | `""` | Additional CSS classes applied to the series host element. |
416
+ | `color` | `string` | `""` | Explicit stroke color override for the series line. |
417
+ | `connectNulls` | `boolean` | `false` | Whether to connect points across null or invalid values without gaps. |
418
+ | `curve` | `ChartCurve` | `"linear"` | Curve interpolation style (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, or `"step-after"`). |
419
+ | `data` | `readonly unknown[] \| undefined` | `undefined` | Series-specific dataset overriding the root chart data. |
420
+ | `dataLabels` | `ChartDataLabelsInput` | `false` | Data label display options or boolean flag enabling default labels. |
421
+ | `downsampling` | `ChartDownsamplingInput \| undefined` | `undefined` | Per-series high-density downsampling override. Undefined inherits the chart policy. |
422
+ | `field` | `ChartField` | `""` | Property key or accessor extracting the Y value for each data item. |
423
+ | `keyField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting a stable datum identity across updates. |
424
+ | `lineStyle` | `ChartLineStyle` | `"solid"` | Stroke pattern used to render the series line (`"solid"`, `"dashed"`, or `"dotted"`). |
425
+ | `name` | `string` | `""` | Name of the series displayed in legends and tooltips. |
426
+ | `pointRadius` | `number \| undefined` | `undefined` | Radius in pixels for point markers. |
427
+ | `seriesKey` | `string \| undefined` | `undefined` | Optional stable key identifying this series for mark identity and selection across updates. |
428
+ | `showPoints` | `boolean` | `false` | Whether to draw point markers at each data coordinate along the line. |
429
+ | `strokeWidth` | `number \| undefined` | `undefined` | Stroke width in pixels for the series line. |
430
+ | `valueFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Formats this series' values in tooltips, data labels and announcements, without changing the axis ticks. Takes precedence over the axis formatter. |
431
+ | `visible` (two-way) | `boolean` | `true` | Whether the series is currently visible on the chart and in calculations. |
432
+ | `xAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used. |
433
+ | `xField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting the X value, overriding the root chart X field. |
434
+ | `yAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian Y axis this series binds to. When omitted, the primary Y axis is used. |
435
+
436
+ #### Outputs
437
+
438
+ | Name | Type | Description |
439
+ | --- | --- | --- |
440
+ | `visibleChange` | `boolean` | Emitted when `visible` changes. |
441
+
442
+ ### Types
443
+
444
+ #### `ChartAreaFillMode`
445
+
446
+ ```typescript
447
+ type ChartAreaFillMode = "gradient" | "solid";
448
+ ```
449
+
450
+ #### `ChartCurve`
451
+
452
+ ```typescript
453
+ type ChartCurve = "linear" | "monotone-x" | "natural" | "step" | "step-after";
454
+ ```
455
+
456
+ #### `ChartLineStyle`
457
+
458
+ ```typescript
459
+ type ChartLineStyle = "solid" | "dashed" | "dotted";
460
+ ```
461
+
462
+ **Documented elsewhere:** [`ChartDataLabelsInput`](chart.md), [`ChartDownsamplingInput`](chart.md), [`ChartField`](chart.md), [`ChartStackMode`](chart.md), [`ChartValueFormatter`](chart.md)