docx 9.7.1 → 9.8.0

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,1235 @@
1
+ import type { DocPropertiesOptions } from 'docx';
2
+ import { DrawingPatch } from 'docx';
3
+ import type { IFloating } from 'docx';
4
+ import type { IRunPropertiesOptions } from 'docx';
5
+ import { Run } from 'docx';
6
+ import { TemplateDrawing } from 'docx';
7
+ import { TemplatePackage } from 'docx';
8
+ import type { ThemeColor } from 'docx';
9
+
10
+ /**
11
+ * An area chart (`c:areaChart`). Series can be drawn as columns or lines instead.
12
+ *
13
+ * @publicApi
14
+ */
15
+ export declare type AreaChartOptions = CategoryChartOptions & {
16
+ readonly type: "area";
17
+ };
18
+
19
+ /**
20
+ * Options of the charts with bars: column (vertical bars) and bar (horizontal bars) charts.
21
+ *
22
+ * @publicApi
23
+ */
24
+ export declare type BarChartBaseOptions = CategoryChartOptions & {
25
+ /**
26
+ * The space between groups of bars, as a percentage of a bar's width, from 0 to 500. Default is Office's: 219 for
27
+ * column charts, 182 for bar charts, and 150 when the series are stacked
28
+ */
29
+ readonly gapWidth?: number;
30
+ /**
31
+ * How much the bars in a group overlap, as a percentage of a bar's width, from -100 (a bar's width apart) to 100.
32
+ * Default is Office's: -27 for column charts and 0 for bar charts. Stacked bars always overlap fully
33
+ */
34
+ readonly overlap?: number;
35
+ };
36
+
37
+ /**
38
+ * A bar chart: horizontal bars (`c:barChart` with `c:barDir="bar"`). The first category is at the bottom, as in Word.
39
+ *
40
+ * @publicApi
41
+ */
42
+ export declare type BarChartOptions = BarChartBaseOptions & {
43
+ readonly type: "bar";
44
+ };
45
+
46
+ /**
47
+ * A bar of pie chart (`c:ofPieChart` with `c:ofPieType="bar"`): the small slices of a pie drawn again as a stacked bar
48
+ * beside it.
49
+ *
50
+ * @publicApi
51
+ */
52
+ export declare type BarOfPieChartOptions = SplitPieChartBaseOptions & {
53
+ readonly type: "barOfPie";
54
+ };
55
+
56
+ /**
57
+ * What the labels on each bubble of a bubble chart show: as {@link ChartDataLabels}, or the bubble's size.
58
+ *
59
+ * @publicApi
60
+ */
61
+ export declare type BubbleChartDataLabels = ChartDataLabels & {
62
+ /** The bubble's size. Default is `false` */
63
+ readonly bubbleSize?: boolean;
64
+ };
65
+
66
+ /**
67
+ * A bubble chart (`c:bubbleChart`): bubbles, each with its own x, y and size, on two value axes.
68
+ *
69
+ * @publicApi
70
+ */
71
+ export declare type BubbleChartOptions = ChartBaseOptions & {
72
+ readonly type: "bubble";
73
+ /** The series, each with its bubbles */
74
+ readonly series: readonly BubbleChartSeries[];
75
+ /** The size of the bubbles, as a percentage of Office's size, from 0 to 300. Default is 100 */
76
+ readonly bubbleScale?: number;
77
+ /** Whether a bubble's size is its area or its width. Default is `"area"` */
78
+ readonly sizeRepresents?: "area" | "width";
79
+ /** The horizontal axis */
80
+ readonly xAxis?: ChartValueAxis;
81
+ /** The vertical axis */
82
+ readonly yAxis?: ChartValueAxis;
83
+ /** Labels on each bubble */
84
+ readonly dataLabels?: BubbleChartDataLabels;
85
+ };
86
+
87
+ /**
88
+ * A bubble of a bubble chart: a point with a size.
89
+ *
90
+ * @publicApi
91
+ */
92
+ export declare type BubbleChartPoint = ChartPoint & {
93
+ /** The bubble's size, compared with the other bubbles'. Can't be negative */
94
+ readonly size: number;
95
+ };
96
+
97
+ /**
98
+ * The label of one bubble of a bubble chart: as {@link ChartPointLabel}, or the bubble's size.
99
+ *
100
+ * @publicApi
101
+ */
102
+ export declare type BubbleChartPointLabel = BubbleChartDataLabels & ChartLabelText;
103
+
104
+ /**
105
+ * A series of a bubble chart: bubbles, each with its own x, y and size.
106
+ *
107
+ * @publicApi
108
+ */
109
+ export declare type BubbleChartSeries = {
110
+ /** The series' name, shown in the legend */
111
+ readonly name: string;
112
+ /** The series' bubbles */
113
+ readonly points: readonly BubbleChartPoint[];
114
+ /** The colour of the series' bubbles. Default is the next of the theme's accent colours */
115
+ readonly color?: string | ThemeColor;
116
+ /** The series' own labels, instead of the chart's `dataLabels`, or `false` for none */
117
+ readonly dataLabels?: false | BubbleChartDataLabels;
118
+ /** Labels of single bubbles, in order: a label of its own, `false` for none, or `undefined` for the series' own */
119
+ readonly pointLabels?: readonly (false | BubbleChartPointLabel | undefined)[];
120
+ /** Lines fitted to the bubbles' centres */
121
+ readonly trendlines?: readonly ChartTrendline[];
122
+ /** Error bars along the x axis, left and right of each bubble's centre */
123
+ readonly xErrorBars?: ChartErrorBars;
124
+ /** Error bars along the y axis, up and down from each bubble's centre */
125
+ readonly yErrorBars?: ChartErrorBars;
126
+ };
127
+
128
+ /**
129
+ * New data for a chart with categories: a column, bar, line, area, pie, doughnut or radar chart.
130
+ *
131
+ * @publicApi
132
+ */
133
+ export declare type CategoryChartDataPatchOptions = {
134
+ /**
135
+ * The categories, in order. If they are all numbers, they are written as numbers. If they are all dates, a column,
136
+ * bar, line or area chart spaces them by date
137
+ */
138
+ readonly categories: readonly (string | number | Date)[] | readonly ChartCategoryGroup[];
139
+ /** The series, one value for each category. A pie chart has one */
140
+ readonly series: readonly CategoryChartDataSeries[];
141
+ /**
142
+ * The chart's alt text description. Default is a description of the chart from its new data, such as "Column chart,
143
+ * Sales. 2025: Jan 10, Feb 20.", and none for a decorative chart. An empty description removes it
144
+ */
145
+ readonly description?: string;
146
+ };
147
+
148
+ /**
149
+ * A series of new data for a chart with categories: a column, bar, line, area, pie, doughnut or radar chart.
150
+ *
151
+ * @publicApi
152
+ */
153
+ export declare type CategoryChartDataSeries = {
154
+ /** The series' name, shown in the legend */
155
+ readonly name: string;
156
+ /** One value for each category, in order. `null` leaves a gap. A series can have fewer values than there are categories */
157
+ readonly values: readonly (number | null)[];
158
+ };
159
+
160
+ /**
161
+ * Options of the charts with categories and values: column, bar, line and area charts.
162
+ *
163
+ * @publicApi
164
+ */
165
+ export declare type CategoryChartOptions = ChartBaseOptions & {
166
+ /**
167
+ * The categories along the chart's category axis, in order. If they are all numbers, they are written as numbers.
168
+ * If they are all dates, the axis is a date axis, which spaces them by date. Groups of categories, such as quarters
169
+ * in years, are labelled in rows, the groups below their categories
170
+ */
171
+ readonly categories: readonly (string | number | Date)[] | readonly ChartCategoryGroup[];
172
+ /** The series, one value for each category */
173
+ readonly series: readonly ChartSeries[];
174
+ /** Whether the series of the chart's `type` are stacked. Default is `"none"` */
175
+ readonly stacking?: ChartStacking;
176
+ /** The axis of categories */
177
+ readonly categoryAxis?: ChartAxis;
178
+ /** The axis of values */
179
+ readonly valueAxis?: ChartValueAxis;
180
+ /** The secondary axis of values, on the right, for series with `axis: "secondary"`. It has no gridlines by default */
181
+ readonly secondaryValueAxis?: ChartValueAxis;
182
+ /** Labels on each bar or point */
183
+ readonly dataLabels?: ChartDataLabels;
184
+ /** How empty values (`null`) are drawn: as gaps, as zero, or with a line joining the points either side. Default is `"gap"` */
185
+ readonly emptyValues?: ChartEmptyValues;
186
+ /** A table of the data under the plot, or `true` for one with Office's borders and legend keys. Default is none */
187
+ readonly dataTable?: boolean | ChartDataTable;
188
+ };
189
+
190
+ /**
191
+ * The fill and border of the chart area, or of the plot area.
192
+ *
193
+ * @publicApi
194
+ */
195
+ export declare type ChartAreaStyle = {
196
+ /** A 6-digit hex colour, a colour of the document's theme, or `"none"` */
197
+ readonly fill?: string | ThemeColor;
198
+ /** The border, or `"none"` */
199
+ readonly border?: "none" | ChartLine;
200
+ };
201
+
202
+ /**
203
+ * An axis: its title, its labels, whether it is shown, and its gridlines.
204
+ *
205
+ * @publicApi
206
+ */
207
+ export declare type ChartAxis = {
208
+ /** The axis' title */
209
+ readonly title?: string | ChartTitle;
210
+ /** Whether the axis and its labels are shown. Default is `true` */
211
+ readonly visible?: boolean;
212
+ /** Whether lines are drawn across the plot at each label. Default is `true` for value axes and `false` for category axes */
213
+ readonly gridlines?: boolean;
214
+ /** Puts the categories or values in reverse order, as Word's "Categories in reverse order" does. Default is `false` */
215
+ readonly reverseOrder?: boolean;
216
+ /**
217
+ * Where this axis crosses the other axis. Default is `"auto"`, or for the secondary value axis, the side opposite the
218
+ * primary: `"maximum"`, or `"minimum"` when the categories are in reverse order. `valueAxis: { crossesAt: "maximum" }`
219
+ * puts the value axis on the right
220
+ */
221
+ readonly crossesAt?: ChartAxisCrossing;
222
+ /** Rotates the labels, in degrees clockwise, from -90 to 90: -45 slants them up to the right. Default is Office's choice */
223
+ readonly labelRotation?: number;
224
+ /**
225
+ * How the labels are written, as an Excel number format such as `"#,##0"`, `"0.0%"`, `"$#,##0"` or, for dates,
226
+ * `"mmm yyyy"`. Default is the values' own
227
+ */
228
+ readonly numberFormat?: string;
229
+ /** The labels' font. Default is 9 points */
230
+ readonly font?: ChartFont;
231
+ };
232
+
233
+ /**
234
+ * Where an axis crosses the other axis: where Office puts it (`"auto"`, at zero, or at the minimum when zero is out of
235
+ * range), at the other axis' minimum or maximum, or at a value on the other axis. On a value axis crossing categories,
236
+ * the value is the category's number, from 1, or when the categories are dates, a date.
237
+ *
238
+ * @publicApi
239
+ */
240
+ export declare type ChartAxisCrossing = "auto" | "minimum" | "maximum" | number | Date;
241
+
242
+ /**
243
+ * Which value axis a series is drawn against: the primary one, on the left, or the secondary one, on the right. A bar
244
+ * chart's are along the bottom and the top.
245
+ *
246
+ * @publicApi
247
+ */
248
+ export declare type ChartAxisGroup = "primary" | "secondary";
249
+
250
+ /**
251
+ * Options every chart has, whatever its type.
252
+ *
253
+ * @publicApi
254
+ */
255
+ export declare type ChartBaseOptions = {
256
+ /** The chart's title, above the plot. Default is no title. Each line of the text is a line of the title */
257
+ readonly title?: string | ChartTitle;
258
+ /** The legend, or `false` for none. Default is a legend below the plot */
259
+ readonly legend?: false | ChartLegend;
260
+ /** The font of all the chart's text, apart from its size. The title's, legend's and others' own fonts are applied over it */
261
+ readonly font?: Omit<ChartFont, "size">;
262
+ /** The chart area's fill and border. Default is a white fill with a light grey border */
263
+ readonly chartArea?: ChartAreaStyle;
264
+ /** The plot area's fill and border. Default is neither */
265
+ readonly plotArea?: ChartAreaStyle;
266
+ /** The chart's size in pixels. Default is 576 by 336 pixels (6 by 3.5 inches), the size Word inserts a chart at */
267
+ readonly transformation?: ChartSize;
268
+ /** Floats the chart on the page instead of placing it inline with text, as for images */
269
+ readonly floating?: IFloating;
270
+ /**
271
+ * A name, description and title for screen readers. Without a description, the chart is described from its data,
272
+ * such as "Column chart, Sales. 2024: Jan 10, Feb 20, Mar 30."
273
+ */
274
+ readonly altText?: DocPropertiesOptions;
275
+ /** Marks the chart as decorative, so screen readers skip it. Default is `false` */
276
+ readonly decorative?: boolean;
277
+ /** Formatting of the run the chart is in, such as `position` to raise or lower it from the text's baseline */
278
+ readonly run?: IRunPropertiesOptions;
279
+ };
280
+
281
+ /**
282
+ * A group of categories, such as the quarters of a year, labelled below them on the category axis. A group holds
283
+ * categories, or groups of its own, such as the months of each quarter of each year.
284
+ *
285
+ * @publicApi
286
+ */
287
+ export declare type ChartCategoryGroup = {
288
+ /** The group's name, such as `"2025"`, below its categories */
289
+ readonly name: string;
290
+ /** The categories in the group, in order, or the groups in it. Every group at the same depth holds the same kind */
291
+ readonly categories: readonly (string | number)[] | readonly ChartCategoryGroup[];
292
+ };
293
+
294
+ /**
295
+ * Error bars of a size of each point's own, such as a range of uncertainty. The amounts are kept in the chart's
296
+ * workbook, beside the data.
297
+ *
298
+ * @publicApi
299
+ */
300
+ export declare type ChartCustomErrorBars = ChartErrorBarsStyle & {
301
+ readonly type: "custom";
302
+ /** How far each bar goes towards higher values, one amount for each value or point, in order. `null` leaves none */
303
+ readonly plus?: readonly (number | null)[];
304
+ /** How far each bar goes towards lower values, one amount for each value or point, in order. `null` leaves none */
305
+ readonly minus?: readonly (number | null)[];
306
+ };
307
+
308
+ /**
309
+ * Where the labels on a series' bars, points or slices are. Each type of chart has its own:
310
+ *
311
+ * - bars: `"center"`, `"insideEnd"`, `"insideBase"` and, unless stacked, `"outsideEnd"`;
312
+ * - lines, scatter and bubble charts: `"center"`, `"left"`, `"right"`, `"above"` and `"below"`;
313
+ * - pie charts: `"center"`, `"insideEnd"`, `"outsideEnd"` and `"bestFit"`.
314
+ *
315
+ * The labels of area, doughnut and radar charts have no position.
316
+ *
317
+ * @publicApi
318
+ */
319
+ export declare type ChartDataLabelPosition = "center" | "insideEnd" | "insideBase" | "outsideEnd" | "left" | "right" | "above" | "below" | "bestFit";
320
+
321
+ /**
322
+ * What the labels on each bar, point or slice show, and where they are. There are no labels unless one of `value`,
323
+ * `category` or `seriesName` is `true`.
324
+ *
325
+ * @publicApi
326
+ */
327
+ export declare type ChartDataLabels = {
328
+ /** The value. Default is `false` */
329
+ readonly value?: boolean;
330
+ /** The category, or on a scatter or bubble chart, the x value. Default is `false` */
331
+ readonly category?: boolean;
332
+ /** The series' name. Default is `false` */
333
+ readonly seriesName?: boolean;
334
+ /**
335
+ * Where the labels are. Default is Office's: outside the end of a bar, in the middle of a stacked bar, to the right of
336
+ * a point, and where they fit best on a pie. A chart's position is for the series drawn as its `type`: series drawn
337
+ * another way keep Office's, unless their own labels give one
338
+ */
339
+ readonly position?: ChartDataLabelPosition;
340
+ /** How the values are written, as an Excel number format such as `"#,##0"` or `"0.0%"`. Default is the values' own */
341
+ readonly numberFormat?: string;
342
+ /** The labels' font. Default is 9 points */
343
+ readonly font?: ChartFont;
344
+ };
345
+
346
+ /**
347
+ * Replaces the data of a chart in a template, found by a placeholder in its alt text, such as `{{sales}}`, keeping its
348
+ * look: its type, title, colours, fonts, labels, axes and legend. Give it as a patch to `patchDocument`, with the
349
+ * placeholder's key.
350
+ *
351
+ * - Each series' name and data are replaced, in the order the series are plotted, and its data is written in the
352
+ * chart's own number formats, such as "0%".
353
+ * - New series copy the look of the template's last series, in their own colour, the next of the theme's accents, as
354
+ * `ChartRun` colours them. Series the new data doesn't have are removed, with any axes only they used.
355
+ * - Points past the new data lose their own colours and labels. When each slice of a pie has its own colour, new
356
+ * slices take the next of the theme's accents.
357
+ * - The chart's workbook is replaced with one holding the new data, so Word's "Edit Data" opens it.
358
+ * - The alt text's description is replaced with a description of the new data.
359
+ *
360
+ * The patch checks the data against the chart's type when the document is patched: a pie chart has one series, a
361
+ * scatter or bubble chart's series have points, and a stock chart has prices, with opening prices and volumes if the
362
+ * template's has them. Put the placeholder in the chart's alt text in Word, in "Alt Text" or "Edit Alt Text". A
363
+ * placeholder in the document's text is left as it is.
364
+ *
365
+ * @publicApi
366
+ *
367
+ * @example
368
+ * ```typescript
369
+ * await patchDocument({
370
+ * outputType: "nodebuffer",
371
+ * data: template,
372
+ * patches: {
373
+ * sales: new ChartDataPatch({
374
+ * categories: ["Jan", "Feb", "Mar"],
375
+ * series: [{ name: "2025", values: [10, 20, 30] }],
376
+ * }),
377
+ * },
378
+ * });
379
+ * ```
380
+ */
381
+ export declare class ChartDataPatch extends DrawingPatch {
382
+ private readonly data;
383
+ private readonly patched;
384
+ /**
385
+ * @throws If there are no series, a series has no name, or has neither values nor points, some series have values
386
+ * and others points, series with values have no categories, or a value, category or point is wrong, as for
387
+ * `ChartRun`
388
+ */
389
+ constructor(options: ChartDataPatchOptions);
390
+ /**
391
+ * Replaces the chart's data, and its workbook, and describes it in its alt text.
392
+ *
393
+ * @throws If the drawing isn't a chart, is a type of chart this can't patch, such as a surface chart, or has something
394
+ * that refers to its workbook's cells other than its data, such as labels from cells, or the data isn't for the
395
+ * chart's type, such as two series for a pie chart
396
+ */
397
+ patch(drawing: TemplateDrawing, template: TemplatePackage): void;
398
+ private patchChart;
399
+ }
400
+
401
+ /**
402
+ * The new data of a chart in a template: categories and each series' values, for a scatter or bubble chart each
403
+ * series' points, or for a stock chart its prices.
404
+ *
405
+ * @publicApi
406
+ */
407
+ export declare type ChartDataPatchOptions = CategoryChartDataPatchOptions | PointChartDataPatchOptions | StockChartDataPatchOptions;
408
+
409
+ /**
410
+ * A table of the chart's data under its plot, as Word's "Data Table" draws it: a row for each series, and a column for
411
+ * each category.
412
+ *
413
+ * @publicApi
414
+ */
415
+ export declare type ChartDataTable = {
416
+ /** Shows each series' key, as in the legend, beside its name. Default is `true` */
417
+ readonly legendKeys?: boolean;
418
+ /** Lines between the rows. Default is `true` */
419
+ readonly horizontalBorders?: boolean;
420
+ /** Lines between the columns. Default is `true` */
421
+ readonly verticalBorders?: boolean;
422
+ /** A line around the table. Default is `true` */
423
+ readonly outline?: boolean;
424
+ /** The table's font. Default is 9 points */
425
+ readonly font?: ChartFont;
426
+ };
427
+
428
+ /**
429
+ * Units a value axis' labels are written in, such as thousands: 25,000 is labelled 25, and the axis is labelled
430
+ * "Thousands".
431
+ *
432
+ * @publicApi
433
+ */
434
+ export declare type ChartDisplayUnits = "hundreds" | "thousands" | "tenThousands" | "hundredThousands" | "millions" | "tenMillions" | "hundredMillions" | "billions" | "trillions";
435
+
436
+ /**
437
+ * How empty values (`null`) are drawn: as gaps, as zero, or, for a line, by joining the points either side.
438
+ *
439
+ * @publicApi
440
+ */
441
+ export declare type ChartEmptyValues = "gap" | "zero" | "connect";
442
+
443
+ /**
444
+ * Error bars: a line from each point of a series, showing how far its value might be off.
445
+ *
446
+ * @publicApi
447
+ */
448
+ export declare type ChartErrorBars = ChartErrorBarsAmount | ChartCustomErrorBars;
449
+
450
+ /**
451
+ * Error bars of a size that follows a rule: a fixed amount, a percentage of each value, a number of standard
452
+ * deviations, or the standard error.
453
+ *
454
+ * @publicApi
455
+ */
456
+ export declare type ChartErrorBarsAmount = ChartErrorBarsStyle & {
457
+ /**
458
+ * Which way the bars go from each point: both ways, or only towards higher values (`"plus"`) or lower ones
459
+ * (`"minus"`). Default is `"both"`
460
+ */
461
+ readonly direction?: "both" | "plus" | "minus";
462
+ } & ({
463
+ /** The same amount at each point */
464
+ readonly type: "fixed";
465
+ /** The amount, 0 or more */
466
+ readonly value: number;
467
+ } | {
468
+ /** A percentage of each point's value */
469
+ readonly type: "percentage";
470
+ /** The percentage, 0 or more */
471
+ readonly value: number;
472
+ } | {
473
+ /** A number of standard deviations of the series' values, from their average */
474
+ readonly type: "standardDeviation";
475
+ /** How many standard deviations, 0 or more. Default is 1 */
476
+ readonly value?: number;
477
+ } | {
478
+ /** The standard error of the series' values */
479
+ readonly type: "standardError";
480
+ });
481
+
482
+ /**
483
+ * What error bars share, whatever their size: which way they go, their end caps and their line.
484
+ *
485
+ * @publicApi
486
+ */
487
+ export declare type ChartErrorBarsStyle = {
488
+ /** Whether the bars end with a short line across them. Default is `true` */
489
+ readonly endCaps?: boolean;
490
+ /** The bars' colour, width and dashes. Default is dark grey, 0.75 points wide */
491
+ readonly line?: ChartLine;
492
+ };
493
+
494
+ /**
495
+ * A font for a chart's text. Anything left out is as Word writes a new chart's text: the theme's body font, not bold,
496
+ * in dark grey.
497
+ *
498
+ * @publicApi
499
+ */
500
+ export declare type ChartFont = {
501
+ /** The typeface, such as `"Arial"`. Default is the theme's body font */
502
+ readonly name?: string;
503
+ /** Size in points, from 1 to 4000. Default is 14 for the chart's title, 10 for axis titles, and 9 for the rest */
504
+ readonly size?: number;
505
+ /** Bold text. Default is `false` */
506
+ readonly bold?: boolean;
507
+ /** Italic text. Default is `false` */
508
+ readonly italics?: boolean;
509
+ /** A 6-digit hex colour such as `"1F4E79"`, or a colour of the document's theme such as `{ theme: "accent1" }` */
510
+ readonly color?: string | ThemeColor;
511
+ };
512
+
513
+ /**
514
+ * Text of a label's own, in place of what it would show.
515
+ *
516
+ * @publicApi
517
+ */
518
+ export declare type ChartLabelText = {
519
+ /**
520
+ * The label's text, in place of the value, category or series' name, such as `"Record high"`. Each line of the text is
521
+ * a line of the label. A label with text shows nothing else
522
+ */
523
+ readonly text?: string;
524
+ };
525
+
526
+ /**
527
+ * The legend: a key to the series, or to the slices of a pie or doughnut chart.
528
+ *
529
+ * @publicApi
530
+ */
531
+ export declare type ChartLegend = {
532
+ /** Where the legend is. Default is `"bottom"`, as in Word 2013 and later */
533
+ readonly position?: ChartLegendPosition;
534
+ /** The legend's font. Default is 9 points */
535
+ readonly font?: ChartFont;
536
+ /**
537
+ * Entries to leave out of the legend, by their text: a series' name, a trendline's name, or on a pie or doughnut
538
+ * chart, a category. The series stays in the chart
539
+ */
540
+ readonly hiddenEntries?: readonly (string | number)[];
541
+ };
542
+
543
+ /**
544
+ * Where the legend is, around the plot: `"topRight"` is in the top right corner.
545
+ *
546
+ * @publicApi
547
+ */
548
+ export declare type ChartLegendPosition = "top" | "bottom" | "left" | "right" | "topRight";
549
+
550
+ /**
551
+ * A line: a series' line, or a border.
552
+ *
553
+ * @publicApi
554
+ */
555
+ export declare type ChartLine = {
556
+ /** A 6-digit hex colour, or a colour of the document's theme. Default is the series' colour, or a border's light grey */
557
+ readonly color?: string | ThemeColor;
558
+ /** Width in points, from 0 to 1584. Default is 2.25 for a line or radar series, 1.5 for a scatter series and 0.75 for a border */
559
+ readonly width?: number;
560
+ /** A dash pattern. Default is `"solid"` */
561
+ readonly dash?: ChartLineDash;
562
+ };
563
+
564
+ /**
565
+ * A preset dash pattern, as for shapes' lines. The "short" patterns are the ones Word calls "Round Dot", "Square Dot"
566
+ * and so on.
567
+ *
568
+ * @publicApi
569
+ */
570
+ export declare type ChartLineDash = "solid" | "dot" | "dash" | "longDash" | "dashDot" | "longDashDot" | "longDashDotDot" | "shortDash" | "shortDot" | "shortDashDot" | "shortDashDotDot";
571
+
572
+ /**
573
+ * A marker drawn at each point of a line, radar or scatter series, in the series' colour.
574
+ *
575
+ * @publicApi
576
+ */
577
+ export declare type ChartMarker = {
578
+ /** The marker's shape. Default is `"circle"` */
579
+ readonly shape?: ChartMarkerShape;
580
+ /** The marker's size in points, from 2 to 72. Default is 5 */
581
+ readonly size?: number;
582
+ };
583
+
584
+ /**
585
+ * The shape of a marker.
586
+ *
587
+ * @publicApi
588
+ */
589
+ export declare type ChartMarkerShape = "circle" | "square" | "diamond" | "triangle" | "x" | "star" | "plus" | "dash" | "dot";
590
+
591
+ /**
592
+ * A point of a scatter chart.
593
+ *
594
+ * @publicApi
595
+ */
596
+ export declare type ChartPoint = {
597
+ /** Its position along the horizontal axis */
598
+ readonly x: number;
599
+ /** Its position along the vertical axis */
600
+ readonly y: number;
601
+ };
602
+
603
+ /**
604
+ * The label of one bar or point, over its series' labels: its own text, or what it shows, where it is, its number
605
+ * format and its font. Anything left out is as the series' labels have it.
606
+ *
607
+ * @publicApi
608
+ */
609
+ export declare type ChartPointLabel = ChartDataLabels & ChartLabelText;
610
+
611
+ /**
612
+ * Represents a chart in a WordprocessingML document: a column, bar, line, area, pie, doughnut, pie of pie, bar of pie,
613
+ * radar, scatter, bubble or stock chart, drawn by Word from its data in the document's theme, as a chart made with
614
+ * Word's Insert Chart is. A column, line or area chart's series can each be drawn another way, as Word's "Combo" charts
615
+ * are.
616
+ *
617
+ * The chart is a part of its own (`word/charts/chart1.xml`), with its data in an embedded workbook, so Word's "Edit
618
+ * Data" opens it in Excel. It sits inline with text unless `floating` is set, and goes in a paragraph, including in a
619
+ * table, header, footer or footnote. Without a description in its `altText`, the chart is described for screen readers
620
+ * from its data.
621
+ *
622
+ * Reference: http://officeopenxml.com/drwOverview.php
623
+ *
624
+ * @publicApi
625
+ *
626
+ * @example
627
+ * ```typescript
628
+ * new Paragraph({
629
+ * children: [
630
+ * new ChartRun({
631
+ * type: "column",
632
+ * title: "Sales",
633
+ * categories: ["Jan", "Feb", "Mar"],
634
+ * series: [
635
+ * { name: "2024", values: [10, 20, 30] },
636
+ * { name: "2025", values: [15, 25, null] },
637
+ * ],
638
+ * }),
639
+ * ],
640
+ * });
641
+ * ```
642
+ */
643
+ export declare class ChartRun extends Run {
644
+ /**
645
+ * @throws If there are no series or categories, a value isn't a finite number or null, a series has more values
646
+ * than there are categories or an option the way it is drawn doesn't have, a pie chart has more than one series or
647
+ * a pie or doughnut chart a negative value, a scatter or bubble point isn't finite numbers, a data label position
648
+ * isn't one the chart's type has, a trendline can't be fitted to its series' values, a stock chart's high is below
649
+ * its low, a hidden legend entry isn't one of the legend's, or an option is out of its range
650
+ */
651
+ constructor(options: ChartRunOptions);
652
+ }
653
+
654
+ /**
655
+ * Options for creating a chart. `type` decides the other options: each type has its own.
656
+ *
657
+ * @see {@link ChartRun}
658
+ * @publicApi
659
+ */
660
+ export declare type ChartRunOptions = ColumnChartOptions | BarChartOptions | LineChartOptions | AreaChartOptions | PieChartOptions | DoughnutChartOptions | PieOfPieChartOptions | BarOfPieChartOptions | RadarChartOptions | ScatterChartOptions | BubbleChartOptions | StockChartOptions;
661
+
662
+ /**
663
+ * A series of a column, bar, line or area chart: one value for each category.
664
+ *
665
+ * `markers`, `smooth` and `line` are for series drawn as lines, and `colors` for series drawn as bars.
666
+ *
667
+ * @publicApi
668
+ */
669
+ export declare type ChartSeries = {
670
+ /** The series' name, shown in the legend */
671
+ readonly name: string;
672
+ /** One value for each category, in order. `null` leaves a gap. A series can have fewer values than there are categories */
673
+ readonly values: readonly (number | null)[];
674
+ /**
675
+ * The colour of the series' bars, line or area: a 6-digit hex colour such as `"4472C4"`, or a colour of the
676
+ * document's theme such as `{ theme: "accent2" }`. Default is the next of the theme's accent colours
677
+ */
678
+ readonly color?: string | ThemeColor;
679
+ /**
680
+ * Draws the series as columns, a line or an area, whatever the chart's `type`, as Word's "Combo" charts do. Default
681
+ * is the chart's `type`. A bar chart's series are all bars
682
+ */
683
+ readonly type?: ComboChartSeriesType;
684
+ /** Draws the series against the secondary value axis, on the right. Default is `"primary"` */
685
+ readonly axis?: ChartAxisGroup;
686
+ /** The series' own labels, instead of the chart's `dataLabels`, or `false` for none */
687
+ readonly dataLabels?: false | ChartDataLabels;
688
+ /**
689
+ * One colour for each bar, in the order of the categories. A bar without one, or with `undefined`, takes the series'
690
+ * colour. Only for series drawn as bars
691
+ */
692
+ readonly colors?: readonly (string | ThemeColor | undefined)[];
693
+ /** Draws a marker at each point, or markers of a shape and size. Default is the chart's `markers`. Only for lines */
694
+ readonly markers?: boolean | ChartMarker;
695
+ /** Draws the line as a smooth curve. Default is the chart's `smooth`. Only for lines */
696
+ readonly smooth?: boolean;
697
+ /** The line's colour, width and dashes. Only for lines */
698
+ readonly line?: ChartLine;
699
+ /**
700
+ * Labels of single bars or points, in the order of the categories: a label of its own, `false` for none, or
701
+ * `undefined` for the series' own
702
+ */
703
+ readonly pointLabels?: readonly (false | ChartPointLabel | undefined)[];
704
+ /** Lines fitted to the values. Not for stacked series */
705
+ readonly trendlines?: readonly ChartTrendline[];
706
+ /** Error bars along the values: up and down from columns, lines and areas, or left and right from a bar chart's bars */
707
+ readonly errorBars?: ChartErrorBars;
708
+ };
709
+
710
+ /**
711
+ * The size of a chart, in pixels.
712
+ *
713
+ * @publicApi
714
+ */
715
+ export declare type ChartSize = {
716
+ /** Width in pixels */
717
+ readonly width: number;
718
+ /** Height in pixels */
719
+ readonly height: number;
720
+ };
721
+
722
+ /**
723
+ * Whether the series of a column, bar, line or area chart are stacked: `"none"` draws them side by side, `"stacked"` on
724
+ * top of each other, and `"percent"` on top of each other as a percentage of the category's total, as Word's "Stacked"
725
+ * and "100% Stacked" charts do.
726
+ *
727
+ * @publicApi
728
+ */
729
+ export declare type ChartStacking = "none" | "stacked" | "percent";
730
+
731
+ /**
732
+ * A title with a font of its own.
733
+ *
734
+ * @publicApi
735
+ */
736
+ export declare type ChartTitle = {
737
+ /** The title. Each line of the text is a line of the title */
738
+ readonly text: string;
739
+ /** The title's font */
740
+ readonly font?: ChartFont;
741
+ };
742
+
743
+ /**
744
+ * A trendline: a line fitted to a series' values, which shows their trend, and can extend it forward or backward as a
745
+ * forecast. It is drawn as a dotted line in the series' colour, and has an entry in the legend.
746
+ *
747
+ * @publicApi
748
+ */
749
+ export declare type ChartTrendline = {
750
+ /** The kind of line fitted to the values */
751
+ readonly type: ChartTrendlineType;
752
+ /** The order of a polynomial trendline, from 2 to 6: 2 has one bend, 3 has two, and so on. Default is 2 */
753
+ readonly order?: number;
754
+ /**
755
+ * How many points each point of a moving average averages, from 2 to one fewer than the series' values or points.
756
+ * Default is 2
757
+ */
758
+ readonly period?: number;
759
+ /** The trendline's name in the legend. Default is Office's, such as "Linear (Sales)" */
760
+ readonly name?: string;
761
+ /**
762
+ * Extends the trendline past the last point by this many categories, or on a scatter or bubble chart, this much along
763
+ * the x axis. Default is 0. Not for moving averages
764
+ */
765
+ readonly forecastForward?: number;
766
+ /**
767
+ * Extends the trendline before the first point by this many categories, or on a scatter or bubble chart, this much
768
+ * along the x axis. Default is 0. Not for moving averages
769
+ */
770
+ readonly forecastBackward?: number;
771
+ /**
772
+ * Where the trendline crosses the vertical axis: its value where x is 0. Default is where the values put it. Only for
773
+ * linear, exponential and polynomial trendlines, and above 0 for exponential ones
774
+ */
775
+ readonly intercept?: number;
776
+ /** Shows the trendline's equation on the chart, such as "y = 2.5x + 4". Default is `false`. Not for moving averages */
777
+ readonly equation?: boolean;
778
+ /** Shows how well the trendline fits the values, its R² value, on the chart. Default is `false`. Not for moving averages */
779
+ readonly rSquared?: boolean;
780
+ /** The equation's and R² value's number format and font */
781
+ readonly label?: ChartTrendlineLabel;
782
+ /** The line's colour, width and dashes. Default is the series' colour, 1.5 points wide, with short dots */
783
+ readonly line?: ChartLine;
784
+ };
785
+
786
+ /**
787
+ * The label of a trendline's equation and R² value.
788
+ *
789
+ * @publicApi
790
+ */
791
+ export declare type ChartTrendlineLabel = {
792
+ /** How the numbers are written, as an Excel number format such as `"#,##0.00"`. Default is `"General"` */
793
+ readonly numberFormat?: string;
794
+ /** The label's font. Default is 9 points */
795
+ readonly font?: ChartFont;
796
+ };
797
+
798
+ /**
799
+ * The kind of line a trendline fits to a series' values:
800
+ *
801
+ * - `"linear"`: a straight line;
802
+ * - `"exponential"`: a curve that rises or falls ever faster, for values above 0;
803
+ * - `"logarithmic"`: a curve that rises or falls quickly, then levels out;
804
+ * - `"polynomial"`: a curve with as many bends as its `order`, less one;
805
+ * - `"power"`: a curve for values that grow at a steady rate, above 0;
806
+ * - `"movingAverage"`: the average of each point and the points before it, which smooths out the ups and downs.
807
+ *
808
+ * @publicApi
809
+ */
810
+ export declare type ChartTrendlineType = "linear" | "exponential" | "logarithmic" | "polynomial" | "power" | "movingAverage";
811
+
812
+ /**
813
+ * The type of a chart, by the name Word gives it in Insert Chart.
814
+ *
815
+ * @publicApi
816
+ */
817
+ export declare type ChartType = ChartRunOptions["type"];
818
+
819
+ /**
820
+ * An axis of values: as {@link ChartAxis}, with its range, the interval between its labels, and its scale. On a 100%
821
+ * stacked chart, the range and interval are percentages.
822
+ *
823
+ * @publicApi
824
+ */
825
+ export declare type ChartValueAxis = ChartAxis & {
826
+ /** The lowest value on the axis. Default is chosen from the values */
827
+ readonly minimum?: number;
828
+ /** The highest value on the axis. Default is chosen from the values */
829
+ readonly maximum?: number;
830
+ /** The interval between the axis' labels and gridlines. Default is chosen from the values */
831
+ readonly interval?: number;
832
+ /**
833
+ * Makes the scale logarithmic, with this base, from 2 to 1000: with 10, the labels are 1, 10, 100 and so on. Values
834
+ * of 0 or less can't be shown. Default is a linear scale
835
+ */
836
+ readonly logarithmicBase?: number;
837
+ /** Writes the labels in hundreds, thousands, millions and so on. Default is the values as they are */
838
+ readonly displayUnits?: ChartDisplayUnits;
839
+ };
840
+
841
+ /**
842
+ * A column chart: vertical bars (`c:barChart` with `c:barDir="col"`). Series can be drawn as lines or areas instead.
843
+ *
844
+ * @publicApi
845
+ */
846
+ export declare type ColumnChartOptions = BarChartBaseOptions & {
847
+ readonly type: "column";
848
+ };
849
+
850
+ /**
851
+ * How a series of a column, line or area chart is drawn, when it isn't drawn as the chart's `type`: as columns, a line
852
+ * or an area. A chart with series of more than one type is Word's "Combo" chart.
853
+ *
854
+ * @publicApi
855
+ */
856
+ export declare type ComboChartSeriesType = "column" | "line" | "area";
857
+
858
+ /**
859
+ * A doughnut chart (`c:doughnutChart`): a ring for each series, the first on the inside.
860
+ *
861
+ * @publicApi
862
+ */
863
+ export declare type DoughnutChartOptions = PieChartBaseOptions & {
864
+ readonly type: "doughnut";
865
+ /** The series, a ring each */
866
+ readonly series: readonly PieChartSeries[];
867
+ /** The size of the hole, as a percentage of the chart's diameter, from 10 to 90. Default is 50 */
868
+ readonly holeSize?: number;
869
+ };
870
+
871
+ /**
872
+ * A line chart (`c:lineChart`). Series can be drawn as columns or areas instead.
873
+ *
874
+ * @publicApi
875
+ */
876
+ export declare type LineChartOptions = CategoryChartOptions & {
877
+ readonly type: "line";
878
+ /** Draws a marker at each point, as Word's "Line with Markers" does, or markers of a shape and size. Default is `false` */
879
+ readonly markers?: boolean | ChartMarker;
880
+ /** Draws the lines as smooth curves. Default is `false` */
881
+ readonly smooth?: boolean;
882
+ };
883
+
884
+ /**
885
+ * Options of pie and doughnut charts.
886
+ *
887
+ * @publicApi
888
+ */
889
+ export declare type PieChartBaseOptions = ChartBaseOptions & {
890
+ /** The categories: one slice of each series for each category */
891
+ readonly categories: readonly (string | number)[];
892
+ /** Labels on each slice */
893
+ readonly dataLabels?: PieChartDataLabels;
894
+ /** Where the first slice starts, in degrees clockwise from 12 o'clock, from 0 to 360. Default is 0 */
895
+ readonly firstSliceAngle?: number;
896
+ };
897
+
898
+ /**
899
+ * What the labels on each slice of a pie or doughnut chart show: as {@link ChartDataLabels}, or the slice's percentage
900
+ * of the whole.
901
+ *
902
+ * @publicApi
903
+ */
904
+ export declare type PieChartDataLabels = ChartDataLabels & {
905
+ /** The slice's percentage of the whole. Default is `false` */
906
+ readonly percentage?: boolean;
907
+ };
908
+
909
+ /**
910
+ * A pie chart (`c:pieChart`), with one series.
911
+ *
912
+ * @publicApi
913
+ */
914
+ export declare type PieChartOptions = PieChartBaseOptions & {
915
+ readonly type: "pie";
916
+ /** The series. A pie chart has one */
917
+ readonly series: readonly PieChartSeries[];
918
+ };
919
+
920
+ /**
921
+ * The label of one slice of a pie or doughnut chart: as {@link ChartPointLabel}, or the slice's percentage.
922
+ *
923
+ * @publicApi
924
+ */
925
+ export declare type PieChartPointLabel = PieChartDataLabels & ChartLabelText;
926
+
927
+ /**
928
+ * The series of a pie chart, or a ring of a doughnut chart: one value, a slice, for each category.
929
+ *
930
+ * @publicApi
931
+ */
932
+ export declare type PieChartSeries = {
933
+ /** The series' name */
934
+ readonly name: string;
935
+ /** One value for each category, in order. `null` leaves the slice out. Values can't be negative */
936
+ readonly values: readonly (number | null)[];
937
+ /**
938
+ * One colour for each slice, as a 6-digit hex colour or a colour of the document's theme. A slice without one, or
939
+ * with `undefined`, takes the next of the theme's accent colours
940
+ */
941
+ readonly colors?: readonly (string | ThemeColor | undefined)[];
942
+ /** The series' own labels, instead of the chart's `dataLabels`, or `false` for none */
943
+ readonly dataLabels?: false | PieChartDataLabels;
944
+ /**
945
+ * Labels of single slices, in the order of the categories: a label of its own, `false` for none, or `undefined` for
946
+ * the series' own
947
+ */
948
+ readonly pointLabels?: readonly (false | PieChartPointLabel | undefined)[];
949
+ /**
950
+ * Pulls the slices out from the centre, by a percentage of the radius from 0 to 400: one amount for every slice, or
951
+ * one for each slice in the order of the categories, where `undefined` leaves a slice in. Default is 0
952
+ */
953
+ readonly explosion?: number | readonly (number | undefined)[];
954
+ };
955
+
956
+ /**
957
+ * How a pie of pie or bar of pie chart picks the slices it moves from the pie to the second plot:
958
+ *
959
+ * - `"position"`: the last `count` categories;
960
+ * - `"value"`: the slices whose values are less than `lessThan`;
961
+ * - `"percentage"`: the slices less than `lessThan` percent of the whole;
962
+ * - `"categories"`: the slices of the categories given.
963
+ *
964
+ * @publicApi
965
+ */
966
+ export declare type PieChartSplit = {
967
+ readonly by: "position";
968
+ /** How many of the last categories go to the second plot, from 1 to the number of categories */
969
+ readonly count: number;
970
+ } | {
971
+ readonly by: "value";
972
+ /** Slices with values less than this go to the second plot */
973
+ readonly lessThan: number;
974
+ } | {
975
+ readonly by: "percentage";
976
+ /** Slices less than this percentage of the whole, from 0 to 100, go to the second plot */
977
+ readonly lessThan: number;
978
+ } | {
979
+ readonly by: "categories";
980
+ /** The categories whose slices go to the second plot */
981
+ readonly categories: readonly (string | number)[];
982
+ };
983
+
984
+ /**
985
+ * A pie of pie chart (`c:ofPieChart` with `c:ofPieType="pie"`): the small slices of a pie drawn again as a second pie
986
+ * beside it.
987
+ *
988
+ * @publicApi
989
+ */
990
+ export declare type PieOfPieChartOptions = SplitPieChartBaseOptions & {
991
+ readonly type: "pieOfPie";
992
+ };
993
+
994
+ /**
995
+ * New data for a scatter or bubble chart.
996
+ *
997
+ * @publicApi
998
+ */
999
+ export declare type PointChartDataPatchOptions = {
1000
+ /** The series, each with its points */
1001
+ readonly series: readonly PointChartDataSeries[];
1002
+ /**
1003
+ * The chart's alt text description. Default is a description of the chart from its new data, and none for a
1004
+ * decorative chart. An empty description removes it
1005
+ */
1006
+ readonly description?: string;
1007
+ };
1008
+
1009
+ /**
1010
+ * A series of new data for a scatter or bubble chart.
1011
+ *
1012
+ * @publicApi
1013
+ */
1014
+ export declare type PointChartDataSeries = {
1015
+ /** The series' name, shown in the legend */
1016
+ readonly name: string;
1017
+ /** The series' points, in order. A bubble chart's points each need a size, which a scatter chart's leave out */
1018
+ readonly points: readonly (ChartPoint | BubbleChartPoint)[];
1019
+ };
1020
+
1021
+ /**
1022
+ * A radar chart (`c:radarChart`): a spoke for each category, and a line around the spokes for each series.
1023
+ *
1024
+ * @publicApi
1025
+ */
1026
+ export declare type RadarChartOptions = ChartBaseOptions & {
1027
+ readonly type: "radar";
1028
+ /** The categories: a spoke each, clockwise from 12 o'clock */
1029
+ readonly categories: readonly (string | number)[];
1030
+ /** The series, one value for each category */
1031
+ readonly series: readonly RadarChartSeries[];
1032
+ /**
1033
+ * Draws a marker at each point, as Word's "Radar with Markers" does, or markers of a shape and size. Default is
1034
+ * `false`. Not for filled charts
1035
+ */
1036
+ readonly markers?: boolean | ChartMarker;
1037
+ /** Fills the area inside each series' line, as Word's "Filled Radar" does. Default is `false` */
1038
+ readonly filled?: boolean;
1039
+ /** The axis of categories: the labels at the end of the spokes, and the spokes, which are its gridlines */
1040
+ readonly categoryAxis?: ChartAxis;
1041
+ /** The axis of values, up the first spoke. Its gridlines are the rings */
1042
+ readonly valueAxis?: ChartValueAxis;
1043
+ /** Labels on each point */
1044
+ readonly dataLabels?: ChartDataLabels;
1045
+ /** How empty values (`null`) are drawn: as gaps, as zero, or with a line joining the points either side. Default is `"gap"` */
1046
+ readonly emptyValues?: ChartEmptyValues;
1047
+ };
1048
+
1049
+ /**
1050
+ * A series of a radar chart: one value for each category, on the category's spoke.
1051
+ *
1052
+ * @publicApi
1053
+ */
1054
+ export declare type RadarChartSeries = {
1055
+ /** The series' name, shown in the legend */
1056
+ readonly name: string;
1057
+ /** One value for each category, in order. `null` leaves a gap */
1058
+ readonly values: readonly (number | null)[];
1059
+ /** The colour of the series' line or area. Default is the next of the theme's accent colours */
1060
+ readonly color?: string | ThemeColor;
1061
+ /** The series' own labels, instead of the chart's `dataLabels`, or `false` for none */
1062
+ readonly dataLabels?: false | ChartDataLabels;
1063
+ /** Draws a marker at each point, or markers of a shape and size. Default is the chart's `markers`. Not for filled charts */
1064
+ readonly markers?: boolean | ChartMarker;
1065
+ /** The line's colour, width and dashes. Not for filled charts */
1066
+ readonly line?: ChartLine;
1067
+ /**
1068
+ * Labels of single points, in the order of the categories: a label of its own, `false` for none, or `undefined` for
1069
+ * the series' own
1070
+ */
1071
+ readonly pointLabels?: readonly (false | ChartPointLabel | undefined)[];
1072
+ };
1073
+
1074
+ /**
1075
+ * A scatter chart (`c:scatterChart`): points, each with its own x and y, on two value axes.
1076
+ *
1077
+ * @publicApi
1078
+ */
1079
+ export declare type ScatterChartOptions = ChartBaseOptions & {
1080
+ readonly type: "scatter";
1081
+ /** The series, each with its points */
1082
+ readonly series: readonly ScatterChartSeries[];
1083
+ /** Draws a marker at each point, or markers of a shape and size. Default is `true` */
1084
+ readonly markers?: boolean | ChartMarker;
1085
+ /** Joins the points of each series: `"none"`, `"straight"` or `"smooth"`. Default is `"none"` */
1086
+ readonly lines?: "none" | "straight" | "smooth";
1087
+ /** The horizontal axis */
1088
+ readonly xAxis?: ChartValueAxis;
1089
+ /** The vertical axis */
1090
+ readonly yAxis?: ChartValueAxis;
1091
+ /** Labels on each point */
1092
+ readonly dataLabels?: ChartDataLabels;
1093
+ };
1094
+
1095
+ /**
1096
+ * A series of a scatter chart: points, each with its own x and y.
1097
+ *
1098
+ * @publicApi
1099
+ */
1100
+ export declare type ScatterChartSeries = {
1101
+ /** The series' name, shown in the legend */
1102
+ readonly name: string;
1103
+ /** The series' points, in order */
1104
+ readonly points: readonly ChartPoint[];
1105
+ /** The colour of the series' markers and line. Default is the next of the theme's accent colours */
1106
+ readonly color?: string | ThemeColor;
1107
+ /** The series' own labels, instead of the chart's `dataLabels`, or `false` for none */
1108
+ readonly dataLabels?: false | ChartDataLabels;
1109
+ /** Draws a marker at each point, or markers of a shape and size. Default is the chart's `markers` */
1110
+ readonly markers?: boolean | ChartMarker;
1111
+ /** The line's colour, width and dashes. Only when the chart's `lines` join the points */
1112
+ readonly line?: ChartLine;
1113
+ /** Labels of single points, in order: a label of its own, `false` for none, or `undefined` for the series' own */
1114
+ readonly pointLabels?: readonly (false | ChartPointLabel | undefined)[];
1115
+ /** Lines fitted to the points */
1116
+ readonly trendlines?: readonly ChartTrendline[];
1117
+ /** Error bars along the x axis, left and right of each point */
1118
+ readonly xErrorBars?: ChartErrorBars;
1119
+ /** Error bars along the y axis, up and down from each point */
1120
+ readonly yErrorBars?: ChartErrorBars;
1121
+ };
1122
+
1123
+ /**
1124
+ * Options of pie of pie and bar of pie charts: a pie with some of its slices taken out, and drawn beside it as a
1125
+ * second pie or a stacked bar, joined to the slice of the pie that stands for them.
1126
+ *
1127
+ * @publicApi
1128
+ */
1129
+ export declare type SplitPieChartBaseOptions = Omit<PieChartBaseOptions, "firstSliceAngle"> & {
1130
+ /** The series. The chart has one */
1131
+ readonly series: readonly PieChartSeries[];
1132
+ /** Which slices go to the second plot. Default is the last third of the categories, rounded up */
1133
+ readonly split?: PieChartSplit;
1134
+ /** The size of the second plot, as a percentage of the pie's, from 5 to 200. Default is 75 */
1135
+ readonly secondPlotSize?: number;
1136
+ /** The gap between the pie and the second plot, as a percentage of the second plot's width, from 0 to 500. Default is 100 */
1137
+ readonly gapWidth?: number;
1138
+ /** The lines joining the pie to the second plot. Default is thin grey lines */
1139
+ readonly seriesLines?: ChartLine;
1140
+ };
1141
+
1142
+ /**
1143
+ * New data for a stock chart: each category's prices, and if the chart has them, its opening prices and volumes.
1144
+ *
1145
+ * @publicApi
1146
+ */
1147
+ export declare type StockChartDataPatchOptions = {
1148
+ /** The categories, such as trading days, in order */
1149
+ readonly categories: readonly (string | number | Date)[];
1150
+ /** Each category's opening price, for a chart with opening prices */
1151
+ readonly open?: readonly (number | null)[];
1152
+ /** Each category's highest price */
1153
+ readonly high: readonly (number | null)[];
1154
+ /** Each category's lowest price */
1155
+ readonly low: readonly (number | null)[];
1156
+ /** Each category's closing price */
1157
+ readonly close: readonly (number | null)[];
1158
+ /** Each category's volume traded, for a chart with volumes */
1159
+ readonly volume?: readonly (number | null)[];
1160
+ /** The series' names, as the legend shows them. Default is "Volume", "Open", "High", "Low" and "Close" */
1161
+ readonly names?: StockChartSeriesNames;
1162
+ /**
1163
+ * The chart's alt text description. Default is a description of the chart from its new data, and none for a
1164
+ * decorative chart. An empty description removes it
1165
+ */
1166
+ readonly description?: string;
1167
+ };
1168
+
1169
+ /**
1170
+ * A stock chart (`c:stockChart`): each category's high and low prices joined by a line, with its closing price, and if
1171
+ * given, its opening price and the volume traded, as Word's "High-Low-Close", "Open-High-Low-Close",
1172
+ * "Volume-High-Low-Close" and "Volume-Open-High-Low-Close" charts. Each price list has one value for each category, in
1173
+ * order, and `null` leaves a gap.
1174
+ *
1175
+ * @publicApi
1176
+ */
1177
+ export declare type StockChartOptions = ChartBaseOptions & {
1178
+ readonly type: "stock";
1179
+ /**
1180
+ * The categories, such as trading days, in order. Dates are spaced evenly, one for each category, so days without
1181
+ * trading, such as weekends, leave no gaps
1182
+ */
1183
+ readonly categories: readonly (string | number | Date)[];
1184
+ /**
1185
+ * Each category's opening price. With it, a bar goes from the open to the close: hollow when the price rose, and
1186
+ * filled when it fell
1187
+ */
1188
+ readonly open?: readonly (number | null)[];
1189
+ /** Each category's highest price */
1190
+ readonly high: readonly (number | null)[];
1191
+ /** Each category's lowest price */
1192
+ readonly low: readonly (number | null)[];
1193
+ /** Each category's closing price */
1194
+ readonly close: readonly (number | null)[];
1195
+ /** Each category's volume traded, drawn as columns against an axis of its own on the left, with the prices' on the right */
1196
+ readonly volume?: readonly (number | null)[];
1197
+ /** The series' names, as the legend shows them */
1198
+ readonly names?: StockChartSeriesNames;
1199
+ /** The axis of categories */
1200
+ readonly categoryAxis?: ChartAxis;
1201
+ /** The axis of prices */
1202
+ readonly valueAxis?: ChartValueAxis;
1203
+ /** The axis of volumes, when there are volumes */
1204
+ readonly volumeAxis?: ChartValueAxis;
1205
+ /** The line from each high to each low. Default is a thin dark grey line */
1206
+ readonly highLowLines?: ChartLine;
1207
+ /** The fill and border of the bars where the price rose, when there are opening prices. Default is white, with a grey border */
1208
+ readonly upBars?: ChartAreaStyle;
1209
+ /** The fill and border of the bars where the price fell, when there are opening prices. Default is dark grey */
1210
+ readonly downBars?: ChartAreaStyle;
1211
+ /** How empty values (`null`) are drawn: as gaps, or as zero. Default is `"gap"` */
1212
+ readonly emptyValues?: ChartEmptyValues;
1213
+ /** A table of the data under the plot, or `true` for one with Office's borders and legend keys. Default is none */
1214
+ readonly dataTable?: boolean | ChartDataTable;
1215
+ };
1216
+
1217
+ /**
1218
+ * The names of a stock chart's series, as the legend shows them.
1219
+ *
1220
+ * @publicApi
1221
+ */
1222
+ export declare type StockChartSeriesNames = {
1223
+ /** Default is `"Volume"` */
1224
+ readonly volume?: string;
1225
+ /** Default is `"Open"` */
1226
+ readonly open?: string;
1227
+ /** Default is `"High"` */
1228
+ readonly high?: string;
1229
+ /** Default is `"Low"` */
1230
+ readonly low?: string;
1231
+ /** Default is `"Close"` */
1232
+ readonly close?: string;
1233
+ };
1234
+
1235
+ export { }