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)[][]


customLabels ​

Get Signature ​

get customLabels(): ChartPointLabel[]

The series' labels that state their own text (c:ser/c:dLbls/c:dLbl with c:tx/c:rich), in document order. A label that only formats or deletes its point has no text and is left out.

Returns ​

ChartPointLabel[]


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


dataPoints ​

Get Signature ​

get dataPoints(): ChartDataPoint[]

The points this series formats on its own (c:dPt), in document order: a bar's per-point colours, a pie's slice colours. A c:dPt with no c:idx is left out.

Returns ​

ChartDataPoint[]


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


gradientFill ​

Get Signature ​

get gradientFill(): GradientFill | null

The series' gradient fill (c:spPr/a:gradFill), or null.

Returns ​

GradientFill | null


index ​

Get Signature ​

get index(): number | null

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

Returns ​

number | null


innerShadow ​

Get Signature ​

get innerShadow(): InnerShadow | null

The series' inner shadow (c:spPr/a:effectLst/a:innerShdw), or null.

Returns ​

InnerShadow | null


invertIfNegative ​

Get Signature ​

get invertIfNegative(): boolean | null

Whether a bar series paints a negative bar inverted (c:invertIfNegative), or null when unstated.

Returns ​

boolean | 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


marker ​

Get Signature ​

get marker(): ChartMarker | null

The series' data-point marker (c:marker), or null when it states none.

Returns ​

ChartMarker | null


name ​

Get Signature ​

get name(): string | null

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

Returns ​

string | null


patternFill ​

Get Signature ​

get patternFill(): PatternFill | null

The series' pattern fill (c:spPr/a:pattFill), or null.

Returns ​

PatternFill | null


shadow ​

Get Signature ​

get shadow(): OuterShadow | null

The series' outer shadow (c:spPr/a:effectLst/a:outerShdw), or null.

Returns ​

OuterShadow | null


shape ​

Get Signature ​

get shape(): string | null

A 3-D bar series' own shape (c:shape: box, cylinder, cone, …), or null when unstated.

Returns ​

string | null


smooth ​

Get Signature ​

get smooth(): boolean | null

Whether a line or scatter series is smoothed (c:smooth), or null when unstated.

Returns ​

boolean | null


valueFormatCode ​

Get Signature ​

get valueFormatCode(): string | null

The number format the series' values are cached in (c:numCache/c:formatCode under c:val, or under c:yVal on a scatter or bubble series), or null when the cache states none. PowerPoint paints a source-linked data label and a data table in it.

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