Skip to main content

Class: ModifyChartHelper

Defined in: src/helper/modify-chart-helper.ts:23

Constructors​

Constructor​

new ModifyChartHelper(): ModifyChartHelper

Returns​

ModifyChartHelper

Methods​

minimizeChartLegend()​

static minimizeChartLegend(): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:350

Set legend coordinates to zero. Could be advantageous for pptx users to be able to maximize a legend easily. Legend will still be selectible for a user.

Returns​

ChartModificationCallback


parseCellValue()​

static parseCellValue(value): string

Defined in: src/helper/modify-chart-helper.ts:787

Parameters​

value​

string | number

Returns​

string


readChartInfo()​

static readChartInfo(info): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:270

Read chart info See __tests__/read-chart-data.test.js

Parameters​

info​

ChartInfo

Returns​

ChartModificationCallback


readWorkbookData()​

static readWorkbookData(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:236

Read chart workbook data See __tests__/read-chart-data.test.js

Parameters​

data​

WorkbookData

Returns​

ChartModificationCallback


removeChartLegend()​

static removeChartLegend(): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:365

Completely remove a chart legend. Please notice: This will trigger PowerPoint to automatically maximize chart space.

Returns​

ChartModificationCallback


removeDataLabels()​

static removeDataLabels(): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:562

Remove datalabels of a chart.

Returns​

ChartModificationCallback


setAxisAttribute()​

static setAxisAttribute(element, tag, value, attribute?): void

Defined in: src/helper/modify-chart-helper.ts:326

Parameters​

element​

Element

tag​

string

value​

string | number | boolean

attribute?​

string

Returns​

void


setAxisRange()​

static setAxisRange(range): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:300

Set range and format for chart axis. Please notice: It will only work if the value to update is not set to "Auto" in powerpoint. Only manually scaled min/max can be altered by this. See __tests__/modify-chart-axis.test.js

Parameters​

range​

ChartAxisRange

Returns​

ChartModificationCallback


setChartBubbles()​

static setChartBubbles(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:167

Set chart data to modify bubble charts. See __tests__/modify-chart-bubbles.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setChartCombo()​

static setChartCombo(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:124

Set chart data to modify combo charts. This type is prepared for first series: bar chart (e.g. total) other series: vertical lines See __tests__/modify-chart-scatter.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setChartData()​

static setChartData(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:29

Set chart data to modify default chart types. See __tests__/modify-existing-chart.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setChartScatter()​

static setChartScatter(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:85

Set chart data to modify scatter charts. See __tests__/modify-chart-scatter.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setChartTitle()​

static setChartTitle(newTitle): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:549

Set the title of a chart. This requires an already existing, manually edited chart title.

Parameters​

newTitle​

string

Returns​

ChartModificationCallback


setChartVerticalLines()​

static setChartVerticalLines(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:52

Set chart data to modify vertical line charts. See __tests__/modify-chart-vertical-lines.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setDataLabelAttributes()​

static setDataLabelAttributes(dataLabel): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:693

Specify a format for DataLabels

Parameters​

dataLabel​

ChartSeriesDataLabelAttributes

Returns​

ChartModificationCallback


setDataPointLabelAttributes()​

static setDataPointLabelAttributes(dataLabel): object

Defined in: src/helper/modify-chart-helper.ts:721

Parameters​

dataLabel​

ChartSeriesDataLabelAttributes

Returns​

object

c:dLblPos​

c:dLblPos: object

c:dLblPos.isRequired​

isRequired: boolean = false

c:dLblPos.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:numFmt​

c:numFmt: object

c:numFmt.isRequired​

isRequired: boolean = false

c:numFmt.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showBubbleSize​

c:showBubbleSize: object

c:showBubbleSize.isRequired​

isRequired: boolean = false

c:showBubbleSize.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showCatName​

c:showCatName: object

c:showCatName.isRequired​

isRequired: boolean = false

c:showCatName.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showLeaderLines​

c:showLeaderLines: object

c:showLeaderLines.isRequired​

isRequired: boolean = false

c:showLeaderLines.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showLegendKey​

c:showLegendKey: object

c:showLegendKey.isRequired​

isRequired: boolean = false

c:showLegendKey.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showPercent​

c:showPercent: object

c:showPercent.isRequired​

isRequired: boolean = false

c:showPercent.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showSerName​

c:showSerName: object

c:showSerName.isRequired​

isRequired: boolean = false

c:showSerName.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:showVal​

c:showVal: object

c:showVal.isRequired​

isRequired: boolean = false

c:showVal.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void

c:spPr​

c:spPr: object

c:spPr.isRequired​

isRequired: boolean = false

c:spPr.modify​

modify: ((element) => void)[]

Parameters​
element​

Element

Returns​

void


setExtendedChartData()​

static setExtendedChartData(data): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:213

Set chart data to modify extended chart types. See __tests__/modify-existing-extended-chart.test.js

Parameters​

data​

ChartData

Returns​

ChartModificationCallback


setLegendPosition()​

static setLegendPosition(legendArea): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:379

Update the coordinates of a chart legend. legendArea coordinates are shares of chart coordinates, e.g. "w: 0.5" means "half of chart width"

Parameters​

legendArea​

ShapeCoordinates

Returns​

ChartModificationCallback


setPlotArea()​

static setPlotArea(plotArea): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:425

Set the plot area coordinates of a chart.

This modifier requires a 'c:manualLayout' element. It will only appear if plot area coordinates are edited manually in ppt before. Recently fresh created charts will not have a manualLayout by default.

This is especially useful if you have problems with edgy elements on a chart area that do not fit into the given space, e.g. when having a lot of data labels. You can increase the chart and decrease the plot area to create a margin.

plotArea coordinates are shares of chart coordinates, e.g. "w: 0.5" means "half of chart width"

Parameters​

plotArea​

ShapeCoordinates

Returns​

ChartModificationCallback


setPointLabelSuffix()​

static setPointLabelSuffix(element, idx, labelStyle): void

Defined in: src/helper/modify-chart-helper.ts:570

Parameters​

element​

Element

idx​

number

labelStyle​

object & ChartDataLabelAttributes

Returns​

void


setWaterFallColumnTotalToLast()​

static setWaterFallColumnTotalToLast(TotalColumnIDX?): ChartModificationCallback

Defined in: src/helper/modify-chart-helper.ts:507

Set a waterfall Total column to last you may also optionally specify a different index.

Parameters​

TotalColumnIDX?​

number

Returns​

ChartModificationCallback