Skip to content

excel chart add

zmworm edited this page Apr 29, 2026 · 53 revisions

Excel: Chart - add

Add an embedded chart for data visualization.

Path: /{SheetName}

Properties

Property Default Description
chartType (required) Chart type (see types below)
title Chart title
data Inline data: Series1:1,2,3;Series2:4,5,6
dataRange Cell range reference (e.g., Sheet1!A1:D5), auto-reads headers and values
series1, series2, ... Named series: Name:val1,val2,val3
categories Category labels (comma-separated, e.g., Q1,Q2,Q3,Q4), or cell range (e.g., Sheet1!A2:A13)
series1.name, series1.values, series1.categories Dotted syntax: series name, values as cell range (e.g., Sheet1!B2:B13), per-series categories
colors Color palette (comma-separated hex RGB)
x 0 Horizontal position
y 0 Vertical position
width 8 Chart width (column units)
height 15 Chart height (row units)
legend true Show legend (true/false; position defaults to bottom). Use none to hide. Positions: top, bottom, left, right, topRight (maps to OOXML tr).
catTitle / htitle Category (X) axis title
axisTitle / vtitle Value (Y) axis title
comboSplit Number of bar series in combo chart (integer)
dataLabels false Show data labels (bool)
labelPos/labelposition Label position: center/ctr, insideEnd/inside, insideBase/base, outsideEnd/outside, bestFit/best/auto, top/t, bottom/b, left/l, right/r
labelFont Label font: "size:color:bold" e.g. "10:FF0000:true"
gridlines/majorGridlines true, none/false, or "color:widthPt:dash"
minorGridlines Same format as gridlines
plotFill/plotAreaFill Plot area background: hex color, gradient "C1-C2[:angle]", or "none"
chartFill/chartAreaFill Chart area background: hex color, gradient "C1-C2[:angle]", or "none"
lineWidth Line width in pt
lineDash/dash solid, dot, dash, dashdot, longdash, longdashdot, longdashdotdot
marker/markers "style:size:color" e.g. "circle:8:FF0000". Styles: circle, diamond, square, triangle, star, x, plus, dash, dot, none
style/styleId Chart style (1-48, or none)
transparency Series transparency (0-100%)
opacity/alpha Series opacity (0-100%)
gradient "color1-color2:angle"
gradients Per-series gradients (semicolon-separated)
gradientFill Chart area gradient fill (e.g. C1-C2:angle)
series{N}.color Per-series solid fill color (e.g. series1.color=FF0000)
name Chart name (surfaced in Selection Pane and accessibility tools)
anchor Cell-range anchor: A1:J20 (spans range) or A1 (single-cell top-left). Alternative to x/y/width/height.
secondaryAxis/secondary Comma-separated 1-based series indices for secondary axis
title.font/titlefont Title typeface (font name)
title.size/titlesize Title font size (pt)
title.color/titlecolor Title font color (hex)
title.bold/titlebold Title bold (true/false)
title.glow/titleglow Title glow: "COLOR-RADIUS-OPACITY" or "none"
title.shadow/titleshadow Title shadow: "COLOR-BLUR-ANGLE-DIST-OPACITY" or "none"
legendfont/legend.font Legend font: "size:color:fontname" e.g. "9:8B949E:Helvetica Neue"
axisfont/axis.font Axis label font: "size:color:fontname" e.g. "10:58626E:Arial"
series.shadow/seriesshadow Series shadow: "COLOR-BLUR-ANGLE-DIST-OPACITY" or "none"
series.outline/seriesoutline Series outline: "COLOR-WIDTH" e.g. "FFFFFF-0.5" or "none"
gapwidth/gap Bar gap width (0-500)
overlap Bar overlap (-100 to 100)
view3d/camera/perspective 3D rotation: "rotX,rotY,perspective" e.g. "15,20,30"
areafill/area.fill Area gradient fill: "C1-C2[:angle]"
referenceLine/refLine Reference line: value or "value:color:width:dash"
colorRule/conditionalColor Conditional coloring rule for data points
increaseColor Waterfall increase color (hex)
decreaseColor Waterfall decrease color (hex)
totalColor Waterfall total color (hex)
smooth false Smooth line curves (line/scatter only)
showMarker/showMarkers Toggle markers on line charts
dropLines false Show vertical drop lines from data points to X axis (line charts)
hiLowLines false Show high-low lines connecting highest/lowest series values (line/stock)
upDownBars false Show gain/loss bars between first and last series (line/stock)
serLines/seriesLines false Show series connector lines (stacked bar/pie-of-pie)
dataTable false Show data table below chart
roundedCorners false Rounded corners on chart area
preset/theme Chart style preset
plotArea.x/y/w/h Manual layout of plot area
title.x/y/w/h Manual layout of chart title
legend.x/y/w/h Manual layout of legend
legend.overlay Legend overlays chart area
dataLabel{N}.text Custom text for data label N
dataLabel{N}.x/y/w/h Manual layout of data label N
dataLabel{N}.delete Hide/show individual data label N
dataLabels.separator Label part separator
dataLabels.numFmt Label number format (e.g., "0.0%")
dataLabels.showLeaderLines Toggle leader lines
dataLabels.showValue / showVal Toggle value flag on data labels
dataLabels.showPercent / showPct Toggle percent flag (useful for pie)
dataLabels.showCatName / showCategoryName Toggle category-name flag
dataLabels.showSerName / showSeriesName Toggle series-name flag
dataLabels.showLegendKey Toggle legend-key flag
axisLine/axis.line Value axis line: "color:width:dash"
catAxisLine Category axis line: "color:width:dash"
axisVisible/axis.visible Hide/show axes
majorTickMark/majorTick Major tick style
minorTickMark/minorTick Minor tick style
tickLabelPos Tick label position
axisOrientation/axisReverse Reverse axis direction
logBase/logScale / yAxisScale Logarithmic value-axis scale. Accepts logBase=10, logScale=true, or yAxisScale=log.
xAxis.labelRotation / valAxis.labelRotation Tick-label rotation in degrees per axis
dispUnits/displayUnits Display units (thousands, millions)
point{N}.color Individual data point color
invertIfNeg/invertIfNegative Invert bars for negative values
explosion/explode Pie slice explosion
errBars/errorBars Error bars type
combotypes/combo.types Per-series chart types in combo

Chart types

Type Variants
column column, columnStacked, columnPercentStacked, column3d
bar bar, barStacked, barPercentStacked, bar3d
line line, lineStacked, linePercentStacked, line3d
pie pie, pie3d
doughnut doughnut
area area, areaStacked, areaPercentStacked, area3d
scatter scatter
bubble bubble
radar radar, spider
stock stock, ohlc
combo combo
waterfall waterfall, wf
funnel funnel
treemap treemap
sunburst sunburst
histogram histogram — see excel-chart-histogram for the full binning + styling vocabulary
boxWhisker boxWhisker — see excel-chart-boxwhisker
pareto pareto — auto-sorts descending, adds cumulative-% overlay line (0–100% secondary axis)

Examples

officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=column \
  --prop title="Monthly Sales" \
  --prop data="Sales:10,20,30,40;Costs:5,10,15,20" \
  --prop categories="Q1,Q2,Q3,Q4" \
  --prop x=5 --prop y=1

officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=pie \
  --prop title="Market Share" \
  --prop series1="Share:40,30,20,10" \
  --prop categories="A,B,C,D"

officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=lineStacked \
  --prop title="Trends" \
  --prop series1="Revenue:100,200,300" \
  --prop series2="Profit:50,80,120" \
  --prop categories="Jan,Feb,Mar" \
  --prop colors="FF0000,00FF00" \
  --prop catTitle="Month" \
  --prop axisTitle="Revenue"

officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=combo \
  --prop title="Revenue vs Growth" \
  --prop series1="Revenue:100,200,300" \
  --prop series2="Growth:5,8,12" \
  --prop categories="Q1,Q2,Q3" \
  --prop comboSplit=1 \
  --prop dataLabels=true

# Waterfall chart
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=waterfall \
  --prop title="P&L Waterfall" \
  --prop data="Flow:Start:1000,Revenue:500,Costs:-300,Tax:-100,Net:1100" \
  --prop increaseColor=70AD47 --prop decreaseColor=FF0000 --prop totalColor=4472C4

# Funnel chart (extended cx:chart)
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=funnel \
  --prop title="Sales Funnel" \
  --prop series1="Stage:1000,800,400,200,100" \
  --prop categories="Leads,Qualified,Proposal,Negotiation,Won"

# Chart with cell range references (dotted syntax)
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=column \
  --prop title="Monthly Sales" \
  --prop series1.name="Revenue" \
  --prop series1.values="Sheet1!B2:B13" \
  --prop series1.categories="Sheet1!A2:A13"

# Bubble chart
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=bubble \
  --prop title="Market" \
  --prop categories="10,20,30" \
  --prop series1="Products:100,200,150"

# Radar chart
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=radar \
  --prop title="Skills" \
  --prop categories="Code,Design,PM" \
  --prop data="Team:8,6,7"

# Stock chart (OHLC)
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=stock \
  --prop categories="Mon,Tue,Wed" \
  --prop series1="Open:100,102,101" \
  --prop series2="High:105,108,106" \
  --prop series3="Low:98,100,99" \
  --prop series4="Close:103,101,104"

# Pareto chart (auto-sorted descending with cumulative-% line)
officecli add data.xlsx /Sheet1 --type chart \
  --prop chartType=pareto \
  --prop title="Defect Pareto" \
  --prop series1="Count:45,30,25,15,10,5" \
  --prop categories="Cracks,Scratches,Chips,Dents,Stains,Other"

Based on OfficeCLI v1.0.64

Clone this wiki locally