{"record":{"id":"6157443faa90ecc3","repo":"iOfficeAI/OfficeCLI","slug":"axis-not-available-on-chart-cachartidx-extended","errorCode":null,"errorMessage":"Axis not available on chart {caChartIdx}: extended charts not supported.","messagePattern":"Axis not available on chart (.+?): extended charts not supported\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Query.cs","lineNumber":679,"sourceCode":"        }\n\n        // Chart axis-by-role sub-path: /Sheet1/chart[N]/axis[@role=ROLE].\n        // Per schemas/help/pptx/chart-axis.json (shared contract).\n        var chartAxisGetMatch = Regex.Match(cellRef,\n            @\"^chart\\[(\\d+)\\]/axis\\[@role=([a-zA-Z0-9_]+)\\]$\");\n        if (chartAxisGetMatch.Success)\n        {\n            var caChartIdx = int.Parse(chartAxisGetMatch.Groups[1].Value);\n            var caRole = chartAxisGetMatch.Groups[2].Value;\n            var caDrawingsPart = worksheet.DrawingsPart;\n            if (caDrawingsPart == null)\n                throw new ArgumentException($\"No charts found in sheet\");\n            var caAllCharts = GetExcelCharts(caDrawingsPart);\n            if (caChartIdx < 1 || caChartIdx > caAllCharts.Count)\n                throw new ArgumentException($\"Chart index {caChartIdx} out of range (1-{caAllCharts.Count})\");\n            var caChartInfo = caAllCharts[caChartIdx - 1];\n            if (caChartInfo.IsExtended || caChartInfo.StandardPart?.ChartSpace == null)\n                throw new ArgumentException($\"Axis not available on chart {caChartIdx}: extended charts not supported.\");\n            var axisNode = ChartHelper.BuildAxisNode(caChartInfo.StandardPart.ChartSpace, caRole, path);\n            if (axisNode == null)\n                throw new ArgumentException($\"Axis with role '{caRole}' not found on chart {caChartIdx}.\");\n            return axisNode;\n        }\n\n        // Chart path: /Sheet1/chart[N] or /Sheet1/chart[N]/series[K]\n        var chartMatch = Regex.Match(cellRef, @\"^chart\\[(\\d+)\\](?:/series\\[(\\d+)\\])?$\");\n        if (chartMatch.Success)\n        {\n            var chartIdx = int.Parse(chartMatch.Groups[1].Value);\n            var drawingsPart = worksheet.DrawingsPart;\n            if (drawingsPart == null)\n                throw new ArgumentException($\"No charts found in sheet\");\n\n            var allCharts = GetExcelCharts(drawingsPart);\n            if (chartIdx < 1 || chartIdx > allCharts.Count)\n                throw new ArgumentException($\"Chart index {chartIdx} out of range (1-{allCharts.Count})\");","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Query.cs#L661-L697","documentation":"Thrown for /Sheet/chart[N]/axis[@role=R] when chart N is an 'extended' chart (Office 2016+ chartEx format: treemap, sunburst, waterfall, histogram, boxAndWhisker, funnel, etc.). Extended charts have no standard ChartSpace and therefore no addressable axes via this API; they store series in the cx: namespace instead. The chart node itself is still readable — it surfaces chartType and seriesCount in Format rather than series Children.","triggerScenarios":"Requesting an axis on a modern chart type inserted by Excel 2016+. handler.Get(\"/Sheet1/chart[2]/axis[@role=primary]\") where chart[2] is an extended chart. Code that assumes every chart exposes a category/value axis.","commonSituations":"Modern chart types (2016+) that lack a classic axis model. Workbook whose charts were upgraded to the extended format. Generic axis-walking code applied to all charts.","solutions":["Detect extended charts first: their node sets seriesCount in Format and has no series Children — treat those as axis-less.","Restrict axis queries to standard (classic) charts.","Catch ArgumentException and fall back to reading chart[N]'s summary properties (chartType, seriesCount)."],"exampleFix":"// before\nvar axis = handler.Get(\"/Sheet1/chart[2]/axis[@role=primary]\"); // throws if extended\n\n// after\nvar chart = handler.Get(\"/Sheet1/chart[2]\");\nbool isExtended = chart.Format.ContainsKey(\"seriesCount\") && !chart.Children.Any(c => c.Type == \"series\");\nif (isExtended) { /* no axes; use chart.Format[\"chartType\"] / [\"seriesCount\"] */ }\nelse { var axis = handler.Get(\"/Sheet1/chart[2]/axis[@role=primary]\"); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// best-effort extended-chart tell: seriesCount in Format, no series Children\nstatic bool LooksExtended(DocumentNode chart) =>\n    chart.Format.ContainsKey(\"seriesCount\") && !chart.Children.Any(c => c.Type == \"series\");","tryCatchPattern":"var chart = handler.Get(\"/Sheet1/chart[2]\");\nif (LooksExtended(chart)) { /* no axes; use chart.Format[\"chartType\"] / [\"seriesCount\"] */ return null; }\ntry { return handler.Get(\"/Sheet1/chart[2]/axis[@role=primary]\"); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"extended\")) { return null; }","preventionTips":["Modern (2016+) chart types (treemap, sunburst, waterfall, etc.) are extended and have no addressable axes.","Detect extended charts by the seriesCount Format key + absent series Children.","Restrict axis queries to standard (classic) charts."],"tags":["excel","charts","axis","extended-charts","capability"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}