How To Use SetElement Method Using xlwings?

Method

The `SetElement` method of the `Chart` object allows you to set chart elements for the specified chart. The method has one parameter that provides options for setting. The possible values of the parameter are shown in the table below.

Name

Value

Description

msoElementChartFloorNone

1200

Do not display chart floor

msoElementChartFloorShow

1201

Display chart floor

msoElementChartTitleAboveChart

2

Display title above the chart

msoElementChartTitleCenteredOverlay

1

Display title centered as overlay

msoElementChartTitleNone

0

Do not display chart title

msoElementChartWallNone

1100

Do not display chart background wall

msoElementChartWallShow

1101

Display chart background wall

msoElementDataLabelBestFit

210

Use best fit data labels

msoElementDataLabelBottom

209

Display data labels at the bottom

msoElementDataLabelCallout

211

Display data labels as callouts

msoElementDataLabelCenter

202

Centered data labels

msoElementDataLabelInsideBase

204

Display data labels inside the base

msoElementDataLabelInsideEnd

203

Display data labels inside the end

msoElementDataLabelLeft

206

Display data labels on the left

msoElementDataLabelNone

200

Do not display data labels

msoElementDataLabelOutSideEnd

205

Display data labels outside the end

msoElementDataLabelRight

207

Display data labels on the right

msoElementDataLabelShow

201

Display data labels

msoElementDataLabelTop

208

Display data labels at the top

msoElementDataTableNone

500

Do not display data table

msoElementDataTableShow

501

Display data table

msoElementDataTableWithLegendKeys

502

Display data table with legend keys

msoElementErrorBarNone

700

Do not display error bars

msoElementErrorBarPercentage

702

Display percentage error bars

msoElementErrorBarStandardDeviation

703

Display standard deviation error bars

msoElementErrorBarStandardError

701

Display standard error error bars

msoElementLegendBottom

104

Display legend at the bottom

msoElementLegendLeft

103

Display legend on the left

msoElementLegendLeftOverlay

106

Overlay legend on the left

msoElementLegendNone

100

Do not display legend

msoElementLegendRight

101

Display legend on the right

msoElementLegendRightOverlay

105

Overlay legend on the right

msoElementLegendTop

102

Display legend at the top

msoElementLineDropHiLoLine

804

Display drop line and high/low lines

msoElementLineDropLine

801

Display drop line

msoElementLineHiLoLine

802

Display high/low line

msoElementLineNone

800

Do not display lines

msoElementLineSeriesLine

803

Display series lines

msoElementPlotAreaNone

1000

Do not display plot area

msoElementPlotAreaShow

1001

Display plot area

April 6, 2026 (0)


Leave a Reply

Your email address will not be published. Required fields are marked *