{"record":{"id":"3b4ded82715b19df","repo":"iOfficeAI/OfficeCLI","slug":"unknown-chart-type-charttype-supported-types","errorCode":null,"errorMessage":"Unknown chart type: '{chartType}'. Supported types: column, bar, line, pie, doughnut, area, scatter, bubble, radar, stock, combo, waterfall, funnel, treemap, sunburst, boxWhisker, histogram, pareto. Modifiers: 3d (e.g. column3d), stacked (e.g. stackedColumn), percentStacked (e.g. percentStackedBar).","messagePattern":"Unknown chart type: '(.+?)'\\. Supported types: column, bar, line, pie, doughnut, area, scatter, bubble, radar, stock, combo, waterfall, funnel, treemap, sunburst, boxWhisker, histogram, pareto\\. Modifiers: 3d \\(e\\.g\\. column3d\\), stacked \\(e\\.g\\. stackedColumn\\), percentStacked \\(e\\.g\\. percentStackedBar\\)\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Chart/ChartHelper.cs","lineNumber":57,"sourceCode":"        ct = ct.Replace(\"percentstacked\", \"\").Replace(\"pstacked\", \"\").Replace(\"stacked\", \"\");\n\n        var kind = ct switch\n        {\n            \"bar\" => \"bar\",\n            \"column\" or \"col\" => \"column\",\n            \"line\" => \"line\",\n            \"pie\" => \"pie\",\n            \"pieofpie\" => \"pieofpie\",\n            \"barofpie\" => \"barofpie\",\n            \"doughnut\" or \"donut\" => \"doughnut\",\n            \"area\" => \"area\",\n            \"scatter\" or \"xy\" => \"scatter\",\n            \"bubble\" => \"bubble\",\n            \"radar\" or \"spider\" => \"radar\",\n            \"stock\" or \"ohlc\" => \"stock\",\n            \"combo\" => \"combo\",\n            \"waterfall\" or \"wf\" => \"waterfall\",\n            _ => throw new ArgumentException(\n                $\"Unknown chart type: '{chartType}'. Supported types: \" +\n                \"column, bar, line, pie, doughnut, area, scatter, bubble, radar, stock, combo, waterfall, \" +\n                \"funnel, treemap, sunburst, boxWhisker, histogram, pareto. \" +\n                \"Modifiers: 3d (e.g. column3d), stacked (e.g. stackedColumn), percentStacked (e.g. percentStackedBar).\")\n        };\n\n        return (kind, is3D, stacked, percentStacked);\n    }\n\n    /// <summary>\n    /// Extended series info that may contain cell references instead of literal data.\n    /// </summary>\n    internal class SeriesInfo\n    {\n        public string Name { get; set; } = \"\";\n        public double[]? Values { get; set; }\n        public string? ValuesRef { get; set; }       // e.g. \"Sheet1!$B$2:$B$13\"\n        public string? CategoriesRef { get; set; }    // e.g. \"Sheet1!$A$2:$A$13\"","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Chart/ChartHelper.cs#L39-L75","documentation":"Thrown by ParseChartType (ChartHelper.cs:57) when the chart type, after normalizing and stripping 3d/stacked/percentStacked modifiers, does not match any supported base type. The message lists the full supported set (column, bar, line, pie, doughnut, area, scatter, bubble, radar, stock, combo, waterfall) plus the available modifiers. This is the top-level type parser, so any unrecognised chart type fails here.","triggerScenarios":"Setting type=<unknown>, e.g. 'scatterPlot', 'barchart', 'radarChart', 'histogram' (note: histogram is listed in the message but is not a parsed arm here), 'sunburst', 'treemap', 'funnel' (also listed but not in the switch).","commonSituations":"Appending 'Chart'/'Plot' to the type name; using a type mentioned in the error's supported list that is actually not yet wired into the switch (funnel/treemap/sunburst/boxWhisker/histogram/pareto); typos like 'col' is accepted but 'colmn' is not.","solutions":["Use one of the parsed base types: bar, column/col, line, pie, pieOfPie, barOfPie, doughnut/donut, area, scatter/xy, bubble, radar/spider, stock/ohlc, combo, waterfall/wf.","Drop the trailing 'Chart'/'Plot' suffix — the parser wants the bare type name.","If you need funnel/treemap/sunburst/boxWhisker/histogram/pareto, note they are advertised but not implemented in this switch; verify support before relying on them."],"exampleFix":"// before\ntype=barchart\n// after\ntype=bar","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> BaseChartTypes = new(StringComparer.OrdinalIgnoreCase)\n{ \"bar\",\"column\",\"col\",\"line\",\"pie\",\"pieofpie\",\"barofpie\",\"doughnut\",\"donut\",\"area\",\"scatter\",\"xy\",\"bubble\",\"radar\",\"spider\",\"stock\",\"ohlc\",\"combo\",\"waterfall\",\"wf\" };\nstatic string ValidateBaseChartType(string type)\n{\n    var ct = SchemaKeyNormalizer.Normalize(type).Replace(\"3d\",\"\").Replace(\"percentstacked\",\"\").Replace(\"pstacked\",\"\").Replace(\"stacked\",\"\");\n    return BaseChartTypes.Contains(ct) ? type : throw new ArgumentException($\"unsupported chart type '{type}'\");\n}","typeGuard":"static bool IsKnownChartType(string type)\n{\n    var ct = SchemaKeyNormalizer.Normalize(type).Replace(\"3d\",\"\").Replace(\"percentstacked\",\"\").Replace(\"pstacked\",\"\").Replace(\"stacked\",\"\");\n    return BaseChartTypes.Contains(ct);\n}","tryCatchPattern":"try { /* set chart type=... */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Unknown chart type\"))\n{ /* present the supported-type list to the user */ }","preventionTips":["Pass the bare type name without a trailing 'Chart'/'Plot' suffix.","Note funnel/treemap/sunburst/boxWhisker/histogram/pareto are advertised but not wired into the parser — verify before use.","Apply modifiers (3d, stacked, percentStacked) only to types that support them."],"tags":["chart","chart-type","validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}