iOfficeAI/OfficeCLI · error · ArgumentException
Chart type '{chartType}' is not supported. OOXML has no Scat
Error message
Chart type '{chartType}' is not supported. OOXML has no Scatter3D or Radar3D variant — both CT_ScatterChart and CT_RadarChart are 2D-only. Use 'scatter' / 'radar' (optionally with radarStyle=filled|marker|standard). What it means
Thrown by ParseChartType (ChartHelper.cs:31) when the chart type is 3D and the base type is scatter/xy or radar/spider. OOXML has no Scatter3D or Radar3D variant — both CT_ScatterChart and CT_RadarChart are strictly 2D. The pre-fix code silently stripped '3d' and produced a flat chart, losing caller intent (round-trip returned scatter/radar, PowerPoint rendered flat). The check runs after the '3d' substring is detected and stripped.
Source
Thrown at src/officecli/Core/Chart/ChartHelper.cs:31
internal static partial class ChartHelper
{
// ==================== Parse Helpers ====================
internal static (string kind, bool is3D, bool stacked, bool percentStacked) ParseChartType(string chartType)
{
var ct = SchemaKeyNormalizer.Normalize(chartType);
var is3D = ct.EndsWith("3d") || ct.Contains("3d");
ct = ct.Replace("3d", "");
// OOXML has no Scatter3D or Radar3D variant — CT_ScatterChart and
// CT_RadarChart are 2D-only. Previously `scatter3d`/`radar3d` silently
// had the `3d` stripped and became plain scatter/radar, losing caller
// intent (round-trip returned `scatter`/`radar`, real PowerPoint
// rendered flat). Reject these forms explicitly with a helpful error
// pointing at the supported alternatives.
if (is3D && (ct == "scatter" || ct == "xy" || ct == "radar" || ct == "spider"))
{
throw new ArgumentException(
$"Chart type '{chartType}' is not supported. " +
"OOXML has no Scatter3D or Radar3D variant — both CT_ScatterChart and CT_RadarChart " +
"are 2D-only. Use 'scatter' / 'radar' (optionally with radarStyle=filled|marker|standard).");
}
var stacked = ct.Contains("stacked") && !ct.Contains("percent");
var percentStacked = ct.Contains("percentstacked") || ct.Contains("pstacked");
ct = ct.Replace("percentstacked", "").Replace("pstacked", "").Replace("stacked", "");
var kind = ct switch
{
"bar" => "bar",
"column" or "col" => "column",
"line" => "line",
"pie" => "pie",
"pieofpie" => "pieofpie",
"barofpie" => "barofpie",
"doughnut" or "donut" => "doughnut",View on GitHub (pinned to 1ced45e900)
Solutions
- Use 'scatter' or 'radar' (2D only) — there is no 3D variant in OOXML.
- For radar, vary appearance with radarStyle=filled|marker|standard instead of a 3D modifier.
- Pick a genuinely 3D-capable type (column3d, bar3d, pie3d) if 3D rendering is required.
Example fix
// before type=scatter3d // after type=scatter
Defensive patterns
Strategy: validation
Validate before calling
static readonly HashSet<string> No3DAllowed = new(StringComparer.OrdinalIgnoreCase) { "scatter","xy","radar","spider" };
static string ValidateChartType(string type)
{
var lower = type.ToLowerInvariant();
var is3D = lower.Contains("3d");
var base_ = lower.Replace("3d","");
if (is3D && No3DAllowed.Contains(base_)) throw new ArgumentException($"no 3D variant for {base_}");
return type;
} Type guard
static bool IsSupportedChartType(string type)
{
var lower = type.ToLowerInvariant();
var is3D = lower.Contains("3d");
var base_ = lower.Replace("3d","");
return !(is3D && No3DAllowed.Contains(base_));
} Try / catch
try { /* set chart type=... */ }
catch (ArgumentException ex) when (ex.Message.Contains("is not supported") && ex.Message.Contains("Scatter3D"))
{ /* fall back to 2D scatter/radar */ } Prevention
- Remember scatter and radar are 2D-only in OOXML — never append '3d'.
- Only column/bar/pie/area have 3D variants.
- Use radarStyle for radar appearance variation instead of a 3D modifier.
When it happens
Trigger: Requesting type=scatter3d, type=radar3d, type=xy3d, type=spider3d, or any 3d-modified scatter/radar variant.
Common situations: Assuming every chart type has a 3D variant (column/bar/pie do, but scatter and radar do not); generically appending '3d' to a user-supplied type; migrating from a tool that offered a pseudo-3D scatter.
Related errors
- movingAvg period must be >= 2 (OOXML ST_Skip MinInclusive=2)
- trendline.period must be >= 2 (OOXML ST_Skip MinInclusive=2)
- Unknown chart type: '{chartType}'. Supported types: column,
- DefinedName '{trimmedInput}' not found
- Invalid dataRange: '{dataRange}'. Expected format: 'Sheet1!A
AI-assisted analysis of iOfficeAI/OfficeCLI@1ced45e900 (2026-08-13).
Data as JSON: /api/errors/6f63fb4389c2bc2c.
Report an issue: GitHub.