You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/docs/spectrum2/line.md
+57-2Lines changed: 57 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,6 +192,61 @@ The transition between segments is seamless — the line connects solid and dott
192
192
193
193
---
194
194
195
+
## Forecast (LineForecast)
196
+
197
+
The `LineForecast` component is an S2-exclusive child of `Line`. It visually distinguishes a forecast region from historical data: the line transitions from solid to dotted at the forecast boundary, a vertical rule marks the start of the forecast, and an optional label appears above the rule.
The `start` value must be a dimension value that exists in the data (for time axes, epoch milliseconds). Rows at or after `start` are rendered as the forecast segment. Rows before `start` use the `metric` field on `Line`; rows in the forecast region use the `metric` field on `LineForecast`.
210
+
211
+
When `gradient` is set on the parent `Line`, the gradient is also rendered in the forecast region at a reduced opacity (40% of the historical gradient) to reinforce the uncertainty of the forecast.
212
+
213
+
### LineForecast props
214
+
215
+
<table>
216
+
<thead>
217
+
<tr>
218
+
<th>name</th>
219
+
<th>type</th>
220
+
<th>default</th>
221
+
<th>description</th>
222
+
</tr>
223
+
</thead>
224
+
<tbody>
225
+
<tr>
226
+
<td>metric *</td>
227
+
<td>string</td>
228
+
<td>–</td>
229
+
<td>Key in the data containing the forecast values.</td>
230
+
</tr>
231
+
<tr>
232
+
<td>start *</td>
233
+
<td>number | string</td>
234
+
<td>–</td>
235
+
<td>Dimension value at which the forecast begins. For time axes, provide epoch milliseconds. Rows at or after this value are rendered as the forecast segment.</td>
236
+
</tr>
237
+
<tr>
238
+
<td>label</td>
239
+
<td>string</td>
240
+
<td>'Forecast'</td>
241
+
<td>Text shown above the boundary rule. Hidden automatically when fewer than 80px remain between the boundary and the right edge of the chart.</td>
242
+
</tr>
243
+
</tbody>
244
+
</table>
245
+
246
+
_* required_
247
+
248
+
---
249
+
195
250
## Line props (S2)
196
251
197
252
:::note Not all base Line props are supported
@@ -210,9 +265,9 @@ The S2 `Line` component does not yet support `onMouseOver`, `onMouseOut`, `Metri
0 commit comments