OfficeCLI 扩展图表实战指南用 cx:chart 家族一键生成 Waterfall、Treemap、Histogram 与 Pareto【免费下载链接】OfficeCLIOfficeCLI 是首款也是最佳的专为 AI 代理设计的命令行工具可用于读取、编辑和自动化处理 Word、Excel 和 PowerPoint 文件。它免费、开源仅包含一个二进制文件无需安装 Office 套件。项目地址: https://gitcode.com/iOfficeAI/OfficeCLI导读Excel 2016 之后引入了一组扩展图表类型office 2016 chartex即cx:chart家族瀑布图、漏斗图、树状图、旭日图、直方图、箱线图和帕累托图。这些图表在传统 cChart 体系中无法表达只能在chartex命名空间下构建。本指南以仓库内 charts-extended.md 及其配套脚本为骨架完整讲解 OfficeCLI 如何通过一条officecli add --type chart命令生成覆盖全部cx:chart属性旋钮的 5 个工作表、18 张图表并深入ChartExBuilder源码揭示 Pareto 双序列合成、直方图 binning 的 Excel 兼容性处理等底层原理。读完后你将能独立用 OfficeCLI 为 AI 工作流批量产出带完整样式渐变标题光晕、配色板、字体、坐标轴的专业级 Excel 扩展图表。三文件协作一个演示两种驱动方式与 OfficeCLI 其他示例一致本演示由三个文件协同构成charts-extended.md 中明确声明文件角色charts-extended.pyPython 脚本通过officecliPython SDKpip install officecli-sdk驱动启动一个 resident 常驻进程以命名管道在每个doc.batch(...)往返中批量发送add指令每个图表的命令行形态都写在注释里可直接复制charts-extended.shShell 脚本逐条执行officecli create / open / add / remove / close / validate与 Python 版产出等效的charts-extended.xlsxcharts-extended.md本指南对应的源文档将每个 Sheet 映射到它演示的特性生成的charts-extended.xlsx包含5 个工作表、18 张图表覆盖cx:chart家族waterfall、funnel、treemap、sunburst、histogram、boxWhisker、pareto支持的每一项属性外加图表元属性anchor、preset、autotitledeleted、plotvisonly。重新生成工作簿两种方式任选cd examples/excel python3 charts-extended.py # SDK 版需要 officecli 二进制在 PATH 上 # 或 bash charts/charts-extended.sh # CLI 版 # → 均产出 charts-extended.xlsx值得注意charts-extended.sh刻意不加set -e。脚本注释说明这是为了容忍向前兼容的 UNSUPPORTED props 警告officecli 此时退出码为 2让脚本继续构建、产出完整文档——这体现了 OfficeCLI 在设计上对旧版本客户端读取新属性旋钮时的宽容策略。特性覆盖总览一张表看懂 18 张图源文档用一张总览表声明每一个扩展图表专属旋钮至少被一张图表覆盖Chart typeSpecific knobsCovered bywaterfallincreaseColor、decreaseColor、totalColor、chartFill、labelFontSheet 1, Chart 1–2funnel(generic styling only)Sheet 1, Chart 3–4paretoauto-sort desc、ownerIdxcumulative-% line、secondary % axisSheet 4, Chart 1–2treemapparentLabelLayoutoverlapping/banner/noneSheet 2, Chart 1/2/3sunburst(generic styling only)Sheet 2, Chart 4histogrambinCount、binSize、intervalClosedr/l、underflowBin、overflowBinSheet 3, Chart 1–4boxWhiskerquartileMethodexclusive/inclusiveSheet 3, Chart 5–6(all types)anchor、preset、autotitledeleted、plotvisonlySheet 5, Chart 1–4除此之外整组图表还统一演示了通用 cx 样式旋钮title.glow、title.shadow、title.bold/size/color、dataLabels、labelFont、legend位置、legendfont、axisfont、colors调色板、chartFill、plotFill。cx:chart 家族的源码级背景在动手之前先理解 OfficeCLI 内部是如何识别并构建这些图表的。从源码看ChartExBuilder.cs 定义了一个大小写不敏感的扩展图表类型集合internal static readonly HashSetstring ExtendedChartTypes new(StringComparer.OrdinalIgnoreCase) { funnel, treemap, sunburst, boxwhisker, histogram, pareto // Pareto is a 2-series structure: clusteredColumn (sorted bars) // paretoLine (cumulative-% overlay). ... };BuildExtendedChartSpace是 Add 路径的入口ChartExBuilder.Setter.cs则承载 Set 路径的SetChartProperties两者共享同一组私有辅助方法见 ChartExBuilder.cs 的注释。两个值得注意的底层细节xmlns:a命名空间必须显式声明。标题、数据标签、轴文本体在输出时会发射a:bodyPr、a:p、a:r、a:t等 DrawingML 元素而 Open XML SDK 不会自动为这些原始元素声明命名空间OfficeCLI 因此在cx:chartSpace根上主动补上xmlns:a声明否则生成的 XML 缺前缀、真实 Excel 会直接拒绝打开错误码0x800A03EC见 ChartExBuilder.cs。cx:axisId以val属性形式写入。SDK 的CX.AxisId类型把 id 建模为文本内容cx:axisId1/cx:axisId但真实 Excel 写的是cx:axisId val1/前者会让 Excel 拒绝打开整个工作簿。因此 OfficeCLI 用OpenXmlUnknownElement发射属性形式——这与下文直方图binCount/binSize的处理是同一个已知权衡见 ChartExBuilder.cs。关于chartFill/plotFill与colors调色板的两个重要说明源文档的 Notes 原文chartFill/plotFill接受纯色十六进制、none或渐变——与常规 cChart 相同的C1-C2:angle以及c1,c2色标列表语法。colors调色板在单序列 cx 图表funnel、treemap、sunburst上是逐数据点生效的每个扇区/瓦片取调色板的下一个颜色以cx:dataPt填充发射点数多于颜色数时循环使用而在多序列 cx 图表如 boxWhisker上colors每个序列一个颜色与常规 cChart 一致。Sheet 1Waterfall Funnel瀑布图与漏斗图第一个工作表放了两张瀑布图财务桥接和两张漏斗图转化管道。瀑布图涨幅/跌幅/合计三色控制# Chart 1 — waterfall with increase/decrease/total colors data labels title glow officecli add charts-extended.xlsx /1-Waterfall Funnel --type chart \ --prop chartTypewaterfall \ --prop titleCash Flow Bridge \ --prop dataStart:1000,Revenue:500,Costs:-300,Tax:-100,Net:1100 \ --prop increaseColor70AD47 --prop decreaseColorFF0000 --prop totalColor4472C4 \ --prop dataLabelstrue \ --prop title.glow00D2FF-6-60 # Chart 2 — waterfall with legend chartFill (solid) custom label font officecli add charts-extended.xlsx /1-Waterfall Funnel --type chart \ --prop chartTypewaterfall \ --prop titleBudget vs Actual \ --prop dataBudget:5000,Sales:2000,Marketing:-800,Ops:-600,Net:5600 \ --prop increaseColor2E75B6 --prop decreaseColorC00000 --prop totalColorFFC000 \ --prop legendbottom \ --prop chartFillF0F4FA \ --prop dataLabelstrue \ --prop labelFont9:333333:true瀑布图的数据用data名字:数值,...的 name:value 对传入正数视为增加项、负数视为减少项最后一个通常为合计。三个颜色旋钮分别控制增加柱、减少柱和合计柱increaseColor—— 增加柱颜色如70AD47绿decreaseColor—— 减少柱颜色如FF0000红totalColor—— 合计柱颜色如4472C4蓝。源码 ChartHelper.Advanced.cs 给出了这三个旋钮的默认值increaseColor ?? 4472C4蓝、decreaseColor ?? FF0000红、totalColor ?? 2E75B6深蓝——不传时即采用这套配色。漏斗图管道数据 标题阴影# Chart 3 — funnel (sales pipeline) with title shadow officecli add charts-extended.xlsx /1-Waterfall Funnel --type chart \ --prop chartTypefunnel \ --prop titleSales Pipeline \ --prop series1Pipeline:1200,850,600,300,120 \ --prop categoriesLeads,Qualified,Proposal,Negotiation,Won \ --prop dataLabelstrue \ --prop title.shadow000000-4-45-2-40 # Chart 4 — funnel (marketing) with custom colors palette, legend/axis fonts officecli add charts-extended.xlsx /1-Waterfall Funnel --type chart \ --prop chartTypefunnel \ --prop titleMarketing Funnel \ --prop series1Users:10000,6500,3200,1800,900,450 \ --prop categoriesImpressions,Clicks,Signups,Active,Paying,Retained \ --prop dataLabelstrue \ --prop legendfont9:8B949E:Helvetica Neue \ --prop axisfont10:58626E:Helvetica Neue漏斗图要求降序的管道数值1200→850→…→120。这里引入两组字体旋钮的取值语法labelFont9:333333:true—— 数据标签字体格式大小:颜色:加粗legendfont9:8B949E:Helvetica Neue—— 图例字体格式大小:颜色:字体名axisfont10:58626E:Helvetica Neue—— 坐标轴字体格式同上title.shadow000000-4-45-2-40—— 标题阴影格式颜色-模糊-角度-距离-不透明度源码注释见 charts-extended.sh。注意Chart 4 刻意省略了colors调色板——如总览节所述单序列 cx 图表上 CLI 只会把调色板第一个颜色应用到整个序列导致所有柱同色注释中说明让 Excel 主题去选默认强调色即可见 charts-extended.py。本 Sheet 特性chartTypewaterfall、increaseColor、decreaseColor、totalColor、chartTypefunnel、降序管道值、dataLabels、title.glow、title.shadow、legendbottom、chartFill纯色十六进制、labelFont、colors调色板、legendfont、axisfont。Sheet 2Treemap Sunburst树状图与旭日图第二工作表包含三张树状图每种parentLabelLayout各一张和一张旭日图。# Chart 1 — treemap with parentLabelLayoutoverlapping dataLabels officecli add charts-extended.xlsx /2-Treemap Sunburst --type chart \ --prop chartTypetreemap \ --prop titleRevenue by Product \ --prop series1Revenue:450,380,310,280,210,180,150,120 \ --prop categoriesLaptops,Phones,Tablets,TVs,Cameras,Audio,Gaming,Wearables \ --prop parentLabelLayoutoverlapping \ --prop dataLabelstrue # Chart 2 — treemap with parentLabelLayoutbanner title styling officecli add charts-extended.xlsx /2-Treemap Sunburst --type chart \ --prop chartTypetreemap \ --prop titleDepartment Budget \ --prop series1Budget:900,750,600,500,420,350,280 \ --prop categoriesEngineering,Sales,Marketing,Support,Finance,HR,Legal \ --prop parentLabelLayoutbanner \ --prop title.boldtrue --prop title.size14 --prop title.color2E5090 # Chart 3 — treemap with parentLabelLayoutnone (flat, no parent header strip) officecli add charts-extended.xlsx /2-Treemap Sunburst --type chart \ --prop chartTypetreemap \ --prop titleFlat Treemap (no parent labels) \ --prop series1Units:250,200,180,160,140,120,100,80,60,40 \ --prop categoriesA,B,C,D,E,F,G,H,I,J \ --prop parentLabelLayoutnone \ --prop dataLabelstrue # Chart 4 — sunburst with chartFill plotFill (solid) colors palette officecli add charts-extended.xlsx /2-Treemap Sunburst --type chart \ --prop chartTypesunburst \ --prop titleMarket Share by Region \ --prop series1Share:35,25,20,15,30,25,20,10,15 \ --prop categoriesNorth,South,East,West,Urban,Suburban,Rural,Online,Retail \ --prop chartFillF8FAFC --prop plotFillFFFFFF \ --prop dataLabelstrue树状图的核心旋钮是parentLabelLayout它控制父级标签的呈现方式。源码 ChartExBuilder.cs 显示其默认值是overlapping三种取值映射到 chartex 的ParentLabelLayoutVal枚举取值含义源码映射overlapping默认父标签与瓦片重叠显示ParentLabelLayoutVal.Overlappingbanner父标签以横幅条带形式显示在瓦片顶部ParentLabelLayoutVal.Bannernone扁平布局不显示父级标题条带ParentLabelLayoutVal.None标题样式也在此演示了title.boldtrue、title.size14、title.color2E5090的组合用法。旭日图使用径向层次布局chartFillF8FAFC与plotFillFFFFFF分别填充图表区与绘图区。注意Chart 4 的colors同样被省略见 charts-extended.py 注释——cx 单序列图表只会取调色板第一个条目让 Excel 主题驱动逐扇区着色效果更好。本 Sheet 特性chartTypetreemap、parentLabelLayoutoverlapping/banner/none、chartTypesunburst、径向层次布局、colors调色板、title.bold/size/color、dataLabels、chartFillplotFill纯色。Sheet 3Histogram BoxWhisker直方图与箱线图第三工作表是 binning 旋钮的全家福四张直方图覆盖自动分箱与全部手动分箱参数两张箱线图各演示一种四分位法。# Chart 1 — histogram with auto-binning (no binCount/binSize) officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypehistogram \ --prop titleTest Scores (auto bins) \ --prop series1Scores:45,52,58,61,63,...,95,97,99 # Chart 2 — histogram with explicit binCount5 title glow officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypehistogram \ --prop titleSales (binCount5) \ --prop series1Sales:120,135,...,620,700 \ --prop binCount5 \ --prop title.glowFFC000-6-50 # Chart 3 — histogram with explicit binSize50 (fixed bin width) label font officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypehistogram \ --prop titleSales (binSize50) \ --prop series1Sales:120,135,...,620,700 \ --prop binSize50 \ --prop dataLabelstrue --prop labelFont9:FFFFFF:true # Chart 4 — histogram with underflowBin overflowBin intervalClosedl officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypehistogram \ --prop titleResponse Time (outlier bins) \ --prop series1ms:40,55,68,75,...,220,280,350 \ --prop underflowBin60 \ --prop overflowBin200 \ --prop intervalClosedl \ --prop dataLabelstrue \ --prop legendnone # Chart 5 — box whisker, two teams, quartileMethodexclusive officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypeboxWhisker \ --prop titleResponse Time by Team (ms) \ --prop series1TeamA:42,55,...,105,120 \ --prop series2TeamB:30,38,...,92,110 \ --prop quartileMethodexclusive \ --prop legendbottom # Chart 6 — box whisker, three departments, quartileMethodinclusive title glow officecli add charts-extended.xlsx /3-Histogram BoxWhisker --type chart \ --prop chartTypeboxWhisker \ --prop titleSalary Distribution (\$k) \ --prop series1Engineering:85,92,...,150,180 \ --prop series2Marketing:60,65,...,98,110 \ --prop series3Sales:55,62,...,160,190 \ --prop quartileMethodinclusive \ --prop title.glow00D2FF-6-60 \ --prop legendbottom直方图的分箱参数直方图通过cx:layoutPr cx:binning承载全部分箱逻辑实现位于 ChartExBuilder.cs。四个旋钮的行为与源码一一对应参数作用源码行为缺省自动分箱由 Excel 决定箱数binning为空元素binCountN显式箱数发射cx:binCount valN/binSizeW显式箱宽固定宽度发射cx:binSize valW/intervalClosedr默认右闭区间(a,b]IntervalClosedSide.RintervalClosedl左闭区间[a,b)IntervalClosedSide.LunderflowBinNN的离群箱截断值binning.Underflow NoverflowBinNN的离群箱截断值binning.Overflow N注意binCount与binSize互斥源码中if (TryGetValue(binCount)) … else if (TryGetValue(binSize))两者同时给出时binCount优先注释称其是更常用的旋钮。箱线图的四分位法quartileMethod控制箱线图使用的四分位计算公式实现见 ChartExBuilder.cs默认exclusive取值含义源码映射exclusive默认排他式四分位不使用中位数参与计算QuartileMethod.Exclusiveinclusive包含式四分位中位数计入子集QuartileMethod.Inclusive同一实现还固定开启均值标记MeanMarker true、关闭均值线MeanLine false并显示离群点Outliers true。箱线图支持多序列2 组对比或 3 组对比且每个序列各自是一个cx:data仅numDim无strDim——源码注释明确任何strDim都会导致 Excel 把所有箱体堆叠到同一个 X 位置见 ChartExBuilder.cs。本 Sheet 特性chartTypehistogram、自动分箱、binCount、binSize与binCount互斥、underflowBinN截断、overflowBinN截断、intervalClosedr默认(a,b]vsintervalClosedl[a,b)、chartTypeboxWhisker、quartileMethodexclusive、quartileMethodinclusive、多序列分组、title.glow、legendbottom、legendnone、labelFont、dataLabels。Sheet 4Pareto帕累托图第四工作表用两张帕累托图演示自动降序排序与累积百分比叠加线。# Chart 1 — categorical Pareto (defect analysis), pre-sorted input officecli add charts-extended.xlsx /4-Pareto --type chart \ --prop chartTypepareto \ --prop titleDefect Pareto \ --prop series1Count:45,30,10,8,5,2 \ --prop categoriesScratches,Dents,Cracks,Chips,Stains,Other \ --prop dataLabelstrue # Chart 2 — Pareto with out-of-order input (auto-sorted desc by officecli) officecli add charts-extended.xlsx /4-Pareto --type chart \ --prop chartTypepareto \ --prop titleRoot Cause Pareto \ --prop series1Tickets:12,87,5,45,3,120,22,67,8,31 \ --prop categoriesNetwork,Auth,DB,Cache,UI,Config,Deploy,Monitor,Queue,Storage \ --prop title.glowFFC000-6-50 \ --prop legendbottom帕累托图是理解 OfficeCLI以用户单序列为输入、内部合成结构思想的绝佳案例。用户只需提供单一序列OfficeCLI 会自动完成两件事降序排序PrepareParetoChartExBuilder.cs按数值降序重排OrderByDescending相等值保持稳定顺序并同步重排分类数组保证最大贡献项排在最前。Chart 2 的乱序输入12,87,5,45,3,120,...会被重排为120,87,67,...并让分类重新对齐。累积百分比叠加线排序后的序列以clusteredColumn条形layoutId绘制随后追加一条paretoLine序列通过ownerIdx0从条形数据派生累积百分比——无需用户提供第二份数据ChartExBuilder.cs。该叠加线挂在次坐标轴0–100%上与柱共用同一范围。源码头注释还揭示了 Pareto 被纳入扩展图表集合的方式ExtendedChartTypes同时包含pareto且DetectExtendedChartType会识别 OfficeCLI 自己生成的单paretoLine序列形态也能识别 MSOExcel写出的clusteredColumn paretoLine成对形态ChartExBuilder.cs——这意味着读取/回写由真实 Excel 创建的帕累托图同样可行。若用户传入多个序列额外序列会被静默忽略因为帕累托本质是单变量分析ChartExBuilder.cs。本 Sheet 特性chartTypepareto、数值与分类的自动降序排序、次坐标轴上的累积百分比叠加线经ownerIdx自动生成、dataLabels、title.glow、legendbottom。Sheet 5Chart Meta图表元属性第五工作表用四张常规图表column/bar/line演示与图表类型无关的四个元级旋钮单元格区域锚定、命名样式预设、显示控制标志。# anchor (cell-range placement) presetcorporate officecli add charts-extended.xlsx /5-Chart Meta --type chart \ --prop chartTypecolumn \ --prop titleanchor presetcorporate \ --prop series1Revenue:120,145,132,160 \ --prop categoriesQ1,Q2,Q3,Q4 \ --prop anchorA1:M20 \ --prop presetcorporate # autotitledeleted plotvisonly officecli add charts-extended.xlsx /5-Chart Meta --type chart \ --prop chartTypebar \ --prop series1Sales:80,95,88,110 \ --prop categoriesQ1,Q2,Q3,Q4 \ --prop x0 --prop y22 --prop width12 --prop height18 \ --prop autotitledeletedtrue \ --prop plotvisonlytrue # presetminimal officecli add charts-extended.xlsx /5-Chart Meta --type chart \ --prop chartTypeline \ --prop titlepresetminimal \ --prop series1A:10,20,15,25 \ --prop series2B:8,14,12,20 \ --prop categoriesW1,W2,W3,W4 \ --prop x13 --prop y0 --prop width12 --prop height18 \ --prop presetminimal # presetdark officecli add charts-extended.xlsx /5-Chart Meta --type chart \ --prop chartTypecolumn \ --prop titlepresetdark \ --prop series1Sales:45,60,55,80 \ --prop categoriesQ1,Q2,Q3,Q4 \ --prop x13 --prop y22 --prop width12 --prop height18 \ --prop presetdark各元属性的含义与取值anchorA1:M20—— 用 A1 记法的双单元格锚定字符串精确定位图表替代x/y/width/height四个位置参数。preset...—— 命名样式包一次设置颜色、字体、填充、边框。源码 ChartPresets.cs 定义了完整的取值集合minimal、dark、corporate、magazine、dashboard、colorful、monochromemono可作为monochrome的别名。其中minimal会剥离网格线、图例、边框与大部分样式只保留数据本身dark则使用深色背景配浅色系列与文字。设置路径在 ChartHelper.Setter.cspreset会被解析为属性字典并递归调用SetChartProperties逐项应用——预设本质是属性批处理机制。传入未知预设名时CLI 会报错并列出全部可用值。autotitledeletedtrue—— 抑制 Excel 在未给title时自动插入的 Chart Title 占位标题当你想完全无标题又不显式传titlenone时使用。plotvisonlytrue—— 跳过隐藏行/列中的数据对应 Excel 中取消勾选显示隐藏的行和列中的数据。本 Sheet 特性anchorA1:M20精确单元格区域锚定、preset7 种命名样式包minimal、dark、corporate、magazine、dashboard、colorful、monochrome、autotitledeletedtrue、plotvisonlytrue。属性参考表完整继承以下是源文档提供的完整属性速查表供脚本编写时直接查阅PropertyApplies toExample valueSheetchartTypewaterfallwaterfallwaterfall1chartTypefunnelfunnelfunnel1chartTypetreemaptreemaptreemap2chartTypesunburstsunburstsunburst2chartTypehistogramhistogramhistogram3chartTypeboxWhiskerboxWhiskerboxWhisker3chartTypeparetoparetopareto4dataname:value pairswaterfallStart:1000,Revenue:500,...1increaseColorwaterfall70AD471decreaseColorwaterfallFF00001totalColorwaterfall4472C41series1Name:values,series2...,series3...all cxTeamA:42,55,...1/2/3categoriesall cx except histogramLeads,Qualified,...1/2parentLabelLayouttreemapoverlapping|banner|none2binCounthistogram53binSizehistogram503intervalClosedhistogramr(default) |l3underflowBinhistogram603overflowBinhistogram2003quartileMethodboxWhiskerexclusive|inclusive3dataLabelsall cxtrue1/2/3labelFontall cx9:FFFFFF:true1/3title.glowall cx00D2FF-6-601/3title.shadowall cx000000-4-45-2-401title.bold/size/colorall cxtrue/14/2E50902legendall cxbottom|none1/3legendfontall cx9:8B949E:Helvetica Neue1axisfontall cx10:58626E:Helvetica Neue1colorsper-point on single-series cx (funnel/treemap/sunburst); per-series on multi-series cx4472C4,5B9BD5,...—chartFill(solid only)all cxF8FAFC1/2plotFill(solid only)all cxFFFFFF2anchorall chart typesA1:M205presetall chart typesminimal|dark|corporate|magazine|dashboard|colorful|monochrome5autotitledeletedall chart typestrue5plotvisonlyall chart typestrue5已知的校验警告schema 与真实 Excel 的差异运行officecli validate charts-extended.xlsx会在直方图的binCount/binSize元素上报告两条 schema 警告[Schema] The element ...:binCount has invalid value . The text value cannot be empty. [Schema] The val attribute is not declared.这是预期行为并非缺陷。原因在 ChartExBuilder.cs 有详细注释Open XML SDK 生成的 schema 将cx:binCount建模为文本值叶子元素binCount5/binCount但真实 Excel 写入并要求的是属性形式binCount val5/。OfficeCLI 通过原始未知元素写入 Excel 兼容的形式SDK 验证器因此报警采用同样的取舍还有cx:axisId见 ChartExBuilder.cs。工作簿在 Excel 中能正常打开与渲染。检查生成结果生成工作簿后可以用三条命令从不同粒度检查产物这些命令本身也是 OfficeCLI 定位/排查图表问题的常用手段officecli query charts-extended.xlsx chart # 列出所有 chart 部件 officecli get charts-extended.xlsx /1-Waterfall Funnel/chart[1] # 按路径取单张图表的完整属性 officecli view charts-extended.xlsx outline # 查看文档结构大纲小结通过charts-extended这一组示例可以看到 OfficeCLI 将 chartex 家族中结构最复杂的图表统一收敛为一条add --type chart命令瀑布图的三色控制、树状图的父标签布局、直方图的四类分箱旋钮、箱线图的四分位法、帕累托图的自动排序与累积百分比合成以及跨类型通用的字体/填充/阴影/预设/锚定元属性。其背后的ChartExBuilder在 SDK 与真实 Excel 的 schema 分歧binCount的val属性、xmlns:a声明、cx:axisId形式上做了细致处理保证产物能直接被 Excel 打开。这套文档示例 CLI/SDK 双实现 源码佐证的范式同样适用于仓库内其他图表专题如 charts/ 下的charts-column、charts-combo、charts-stock等逐类型深潜示例可作为扩展图表自动化生产的直接参考模板。【免费下载链接】OfficeCLIOfficeCLI 是首款也是最佳的专为 AI 代理设计的命令行工具可用于读取、编辑和自动化处理 Word、Excel 和 PowerPoint 文件。它免费、开源仅包含一个二进制文件无需安装 Office 套件。项目地址: https://gitcode.com/iOfficeAI/OfficeCLI创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考