Skip to content

Class: ChartSeries ​

One data series (c:ser) of a chart.

Constructors ​

Constructor ​

new ChartSeries(ser, part): ChartSeries

Parameters ​

ParameterTypeDescription
serElement-
partPartThe owning chart's OPC part, so markDirty can reach it from element_.

Returns ​

ChartSeries

Accessors ​

bubbleSizes ​

Get Signature ​

get bubbleSizes(): (number | null)[]

Cached bubble sizes of a bubble series (c:bubbleSize); non-numeric or missing points are null.

Returns ​

(number | null)[]


categories ​

Get Signature ​

get categories(): (string | null)[]

Cached category labels for this series (c:cat), as written. On a multi-level axis this is the leaf level, the labels next to the plot; categoryLevels has the rest.

Returns ​

(string | null)[]


categoryLevels ​

Get Signature ​

get categoryLevels(): (string | null)[][]

Every level of cached category labels (c:cat), leaf first: the order PowerPoint writes the c:multiLvlStrCache/c:lvl children in, and the order OptsChartData.labels takes them. Each level is as long as the leaf level. An outer level names a group once, at the group's first category, so the other slots of that group are null. A single-level axis reads as one level, and a series with no categories as none.

Returns ​

(string | null)[][]


dataLabels ​

Get Signature ​

get dataLabels(): ChartDataLabels | null

The data-label settings this series carries itself (c:ser/c:dLbls), or null when it has none. This is where a pie's labels are: see Chart.dataLabels.

Returns ​

ChartDataLabels | null


element_ ​

Get Signature ​

get element_(): Element

Escape hatch: the underlying c:ser element. After mutating it call markDirty, or save() writes the original bytes.

Returns ​

Element


fill ​

Get Signature ​

get fill(): ChartFill | null

Series fill (c:spPr solid fill / no-fill). null when the series carries no c:spPr or its c:spPr declares no fill choice (inherits the theme).

Returns ​

ChartFill | null


index ​

Get Signature ​

get index(): number | null

Series index (c:idx/@val), or null if absent.

Returns ​

number | null


line ​

Get Signature ​

get line(): ChartLine | null

Series line/stroke (c:spPr/a:ln) — width, dash, colour. null when the series c:spPr has no a:ln (bar/area fills carry no line by default).

Returns ​

ChartLine | null


name ​

Get Signature ​

get name(): string | null

Series name from the cached c:tx, or null when unnamed.

Returns ​

string | null


values ​

Get Signature ​

get values(): (number | null)[]

Cached numeric values (c:val); non-numeric or missing points are null. Empty on a scatter or bubble series, which caches its values as yValues instead.

Returns ​

(number | null)[]


xLabels ​

Get Signature ​

get xLabels(): (string | null)[] | null

The X labels of a series plotted against text (c:xVal holding a string cache rather than numbers), as written, or null when its X values are numbers or absent.

One text cell makes the whole X column a string cache, so the numbers in it arrive as text too. PowerPoint then plots the points at X = 1, 2, … n in point order and uses none of the labels as a coordinate, not even one that reads as a number.

Returns ​

(string | null)[] | null


xValues ​

Get Signature ​

get xValues(): (number | null)[]

Cached X values of a scatter or bubble series (c:xVal); missing points are null. A series plotted against text X labels reads null at every point, a label that looks like a number included: xLabels has the text. A series with no c:xVal reads [], and PowerPoint plots it at X = 1, 2, … n, as it does a series plotted against text.

Returns ​

(number | null)[]


yValues ​

Get Signature ​

get yValues(): (number | null)[]

Cached Y values of a scatter or bubble series (c:yVal); non-numeric or missing points are null.

Returns ​

(number | null)[]

Methods ​

markDirty() ​

markDirty(): void

Mark the owning chart part dirty so save() reserializes it. Call after mutating element_.

Returns ​

void