Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

excel chart pie

zmworm edited this page Apr 29, 2026 · 17 revisions

Excel: Chart - pie

A dedicated page for the pie chart type. Pie charts display proportional data as slices of a circle. They support one series with per-slice coloring, explosion, rotation, data labels, and the full set of shared chart styling properties (title, legend, fills, borders, layout, shadow, transparency).

Path: /{SheetName}/chart[N]

Add command shape:

officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop title="Market Share" \
 --prop data="Share:40,30,20,10" \
 --prop categories="Product A,Product B,Product C,Other" \
 <styling props>

See also: Chart - add, Chart - set, doughnut for the ring variant, and the full runnable demo at examples/excel/charts-pie.md.

Chart type variants

Type string OOXML element Description
pie c:pieChart Standard 2D pie
pie3d c:pie3DChart 3D pie with perspective

Pie-specific properties

Slice explosion

Property Default Notes
explosion / explode 0 Pull all slices outward (0-400)
series{N}.point{M}.explosion 0 Per-slice explosion
# Explode all slices
officecli set data.xlsx /Sheet1/chart[1] --prop explosion=25
# Explode just the first slice
officecli set data.xlsx /Sheet1/chart[1] --prop series1.point1.explode=30

First slice angle

Property Default Notes
firstSliceAngle / sliceAngle 0 Rotation of first slice in degrees (0-360)
officecli set data.xlsx /Sheet1/chart[1] --prop firstSliceAngle=90

Per-slice colors

Pie charts use per-data-point colors (not per-series). The colors property sets the palette; individual points can be overridden.

Property Default Notes
colors theme accents Comma-separated hex colors for slices
point{N}.color Override individual slice color
officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop data="Market:40,30,20,10" \
 --prop categories="A,B,C,D" \
 --prop colors="4472C4,ED7D31,70AD47,FFC000"

Data labels

Property Default Notes
dataLabels false true, percent, value, category, all
labelPos / labelPosition bestFit center, insideEnd, outsideEnd, bestFit
labelFont "size:color:bold"
dataLabels.separator Separator between label parts
dataLabels.numFmt Number format for labels
officecli set data.xlsx /Sheet1/chart[1] --prop dataLabels=percent
# Labels with custom font
officecli set data.xlsx /Sheet1/chart[1] \
 --prop dataLabels=all \
 --prop "labelFont=10:333333:true"

Transparency and opacity

Property Default Notes
transparency 0 Series transparency (0-100%)
opacity / alpha 100 Series opacity (0-100%)
# Translucent slices
officecli set data.xlsx /Sheet1/chart[1] --prop transparency=30

Title styling

Property Default Notes
title Chart title text
title.font / titleFont Font family
title.size / titleSize Font size (pt)
title.color / titleColor Font color (hex)
title.bold / titleBold Bold (true/false)
title.glow / titleGlow Glow: "COLOR-RADIUS-OPACITY" or "none"
title.shadow / titleShadow Shadow: "COLOR-BLUR-ANGLE-DIST-OPACITY" or "none"
officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop title="Revenue Breakdown" \
 --prop title.size=16 --prop title.bold=true \
 --prop title.font="Arial" --prop title.color=1F2937 \
 --prop data="Rev:55,25,20" --prop categories="US,EU,APAC"

Legend

Property Default Notes
legend true Position: top, bottom, left, right, none
legend.overlay false Float legend on top of the chart
legendFont / legend.font "size:color:fontname"
officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop data="Share:40,30,20,10" --prop categories="A,B,C,D" \
 --prop legend=right \
 --prop "legendfont=9:6B7280:Arial"

Fills and borders

Property Default Notes
plotFill / plotAreaFill Plot area background: hex, gradient "C1-C2[:angle]", or "none"
chartFill / chartAreaFill Chart area background
plotArea.border / plotBorder Plot area outline: "color:width:dash" or "none"
chartArea.border / chartBorder Chart area outline
chartArea.border=D0D0D0:1:solid"

Series shadow and outline

Property Default Notes
series.shadow / seriesShadow "COLOR-BLUR-ANGLE-DIST-OPACITY" or "none"
series.outline / seriesOutline "COLOR-WIDTH" e.g. "FFFFFF-0.5" or "none"
# White outline between slices + drop shadow
officecli set data.xlsx /Sheet1/chart[1] \
 --prop "series.outline=FFFFFF-1" \
 --prop "series.shadow=000000-4-315-3-40"

Layout control

Property Default Notes
x, y 0 Chart position (column/row index)
width 8 Chart width (column units)
height 15 Chart height (row units)
plotArea.x/y/w/h Manual plot area layout (0-1 decimal)
title.x/y/w/h Manual title layout
legend.x/y/w/h Manual legend layout
officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop data="Share:40,30,20,10" --prop categories="A,B,C,D" \
 --prop x=0 --prop y=0 --prop width=10 --prop height=18

3D settings

Property Default Notes
view3d / camera / perspective "rotX,rotY,perspective" e.g. "30,0,0"

Applies only to pie3d chart type. For pie charts, rotY controls the horizontal rotation of the pie and rotX controls the tilt angle.

officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie3d \
 --prop data="Rev:55,25,20" --prop categories="US,EU,APAC" \
 --prop "view3d=30,0,0"

Full example: presentation-grade pie chart

officecli add data.xlsx /Sheet1 --type chart \
 --prop chartType=pie \
 --prop title="Q4 Revenue by Region" \
 --prop title.size=16 --prop title.bold=true \
 --prop title.font="Arial" --prop title.color=1F2937 \
 --prop data="Revenue:45,28,17,10" \
 --prop categories="North America,Europe,Asia Pacific,Other" \
 --prop colors="4472C4,ED7D31,70AD47,FFC000" \
 --prop firstSliceAngle=90 \
 --prop explosion=5 \
 --prop dataLabels=percent \
 --prop labelPos=outsideEnd \
 --prop "labelFont=10:333333:true" \
 --prop legend=right \
 --prop "legendfont=9:6B7280:Arial" \
 --prop chartFill=FAFBFC \
 --prop "series.outline=FFFFFF-1" \
 --prop x=0 --prop y=0 --prop width=12 --prop height=18

HTML preview support

Feature Preview Notes
2D pie slices Yes SVG arc paths
Per-slice colors Yes From theme or custom
Data labels (%, value) Yes Suppressed for slices <5%
3D pie Yes Ellipse distortion with depth
Explosion No Stored in OOXML but not rendered
Title styling Yes Font, size, color, bold
Legend positioning Yes Top, bottom, left, right
Plot/chart fills Yes Solid and gradient
Shadow effects No Decorative; not rendered
Glow effects No Decorative; not rendered

Known quirks

  • Single series only. Pie charts take one series; multiple series are not supported.
  • varyColors is always true. Automatically set so each slice gets its own color from the palette.
  • No axes or gridlines. Pie charts do not have category or value axes. Properties like axisMin, gridlines, referenceLine, and marker are not applicable.
  • 3D pie falls back to simplified rendering in preview. pie3d is rendered with ellipse distortion but without full 3D lighting. Use Excel for 3D QA.

Inspect an existing pie chart

# List all charts
officecli query charts-pie.xlsx chart
# Inspect a specific chart
officecli get charts-pie.xlsx "/Sheet1/chart[1]"
# Render to HTML preview
officecli view charts-pie.xlsx html > preview.html

See Also


Based on OfficeCLI v1.0.64

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /