{"record":{"id":"8a53d19a40b3963d","repo":"iOfficeAI/OfficeCLI","slug":"chart-at-parentpath-is-not-a-standard-chart-ext","errorCode":null,"errorMessage":"Chart at {parentPath} is not a standard chart (extended cx charts do not support add series).","messagePattern":"Chart at (.+?) is not a standard chart \\(extended cx charts do not support add series\\)\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Add.Chart.cs","lineNumber":391,"sourceCode":"    // range-referenced series (CONSISTENCY(chart-series-rangeref-cache)).\n    private string AddChartSeries(string parentPath, Dictionary<string, string> properties)\n    {\n        var m = Regex.Match(parentPath, @\"^/([^/]+)/chart\\[(\\d+)\\]$\");\n        if (!m.Success)\n            throw new ArgumentException(\n                \"series must be added to a chart parent: /SheetName/chart[N]\");\n        var sheetName = m.Groups[1].Value;\n        var chartIdx = int.Parse(m.Groups[2].Value);\n        var worksheet = FindWorksheet(sheetName)\n            ?? throw new ArgumentException($\"Sheet not found: {sheetName}\");\n        var drawingsPart = worksheet.DrawingsPart\n            ?? throw new ArgumentException(\"Sheet has no drawings/charts\");\n        var excelCharts = GetExcelCharts(drawingsPart);\n        if (chartIdx < 1 || chartIdx > excelCharts.Count)\n            throw new ArgumentException($\"Chart {chartIdx} not found (total: {excelCharts.Count})\");\n        var chartInfo = excelCharts[chartIdx - 1];\n        if (chartInfo.StandardPart == null)\n            throw new ArgumentException(\n                $\"Chart at {parentPath} is not a standard chart (extended cx charts do not support add series).\");\n        var chartPart = chartInfo.StandardPart;\n\n        // Resolve range-reference values/categories against the workbook so\n        // AddSeries seeds literal data (which becomes the cached snapshot).\n        // Mutate `properties` in place instead of copying: enumerating a\n        // TrackingPropertyDictionary into a fresh dict marks EVERY key as\n        // consumed (see TrackingPropertyDictionary.GetEnumerator), which\n        // silently swallows unsupported_property reporting for unknown keys.\n        // TryGetValue / indexer / Remove are the tracked access routes.\n        string? valuesRef = null, categoriesRef = null;\n        List<string>? cachedCats = null;\n        if (properties.TryGetValue(\"values\", out var valRaw) && ChartHelper.IsRangeReference(valRaw))\n        {\n            valuesRef = ChartHelper.NormalizeRangeReference(valRaw, sheetName);\n            var cells = ResolveRangeToCellValues(valRaw, sheetName);\n            if (cells != null)\n                properties[\"values\"] = string.Join(\",\", cells.Select(v =>","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Add.Chart.cs#L373-L409","documentation":"Thrown by AddChartSeries when the target chart is an extended (cx) chart rather than a standard OOXML chart. Extended chart types (funnel, treemap, sunburst, histogram, boxWhisker, etc.) are backed by ChartExPart, which has a different XML structure (cx:nvChartSpace) and does not support the AddSeries operation. The check is chartInfo.StandardPart == null.","triggerScenarios":"Creating a chart with an extended type (e.g. chartType=treemap) and then calling add /Sheet/chart[N] --type chart-series. The chart resolves successfully (index is valid) but its StandardPart is null because it is a ChartEx.","commonSituations":"User creates a modern chart type (treemap, funnel, sunburst) and then tries to append series the same way as for bar/line/pie charts. The error is explicit because AddSeries only works on ChartPart (standard charts), not ChartExPart.","solutions":["Recreate the chart as a standard type (bar, line, pie, etc.) if you need to append series dynamically.","Provide all series upfront when creating an extended-type chart via data= or multiple seriesN= properties.","If you must use an extended type, delete and recreate the chart with the full series set rather than appending."],"exampleFix":"// before (treemap is an extended chart type)\nadd /Sheet1/chart --type chart --chartType treemap --data \"S1:1,2,3\"\nadd /Sheet1/chart[1] --type chart-series --data \"S2:5,6,7\"\n// after (use a standard type, or supply all series at creation)\nadd /Sheet1/chart --type chart --chartType bar --data \"S1:1,2,3;S2:5,6,7\"","handlingStrategy":"validation","validationCode":"// Check whether the chart is an extended (cx) chart before appending series\nvar chartInfo = charts[chartIdx - 1];\nif (chartInfo.StandardPart == null)\n    throw new InvalidOperationException(\n        $\"Chart at {parentPath} is an extended (cx) chart; AddSeries is not supported. \" +\n        \"Recreate with all series, or use a standard chart type.\");","typeGuard":"static bool IsStandardChart(ChartInfo info) => info.StandardPart != null;","tryCatchPattern":"try { handler.AddChartSeries(parentPath, properties); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"not a standard chart\"))\n{\n    Console.Error.WriteLine($\"{ex.Message} Recreate the chart with all series upfront.\");\n}","preventionTips":["Only use standard chart types (bar, line, pie, etc.) if you plan to append series later.","Provide all series at creation time for extended chart types (treemap, funnel, sunburst).","Check chartInfo.StandardPart != null before calling AddSeries.","Document which chart types are extended so users know the limitation."],"tags":["excel","chart","series","extended-chart","cx","unsupported"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}