{"record":{"id":"cafae78c8e9bdc0c","repo":"iOfficeAI/OfficeCLI","slug":"series-name-has-no-data-values-expected-forma","errorCode":null,"errorMessage":"Series '{name}' has no data values. Expected format: 'Name:1,2,3'","messagePattern":"Series '(.+?)' has no data values\\. Expected format: 'Name:1,2,3'","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Chart/ChartHelper.cs","lineNumber":297,"sourceCode":"                // Check if comma-separated parts each contain a colon (name:value pairs)\n                var commaParts = dataStr.Split(',', StringSplitOptions.RemoveEmptyEntries);\n                if (commaParts.Length > 1 && commaParts.All(p => p.Contains(':')))\n                    seriesParts = commaParts;\n                else\n                    seriesParts = new[] { dataStr };\n            }\n\n            foreach (var seriesPart in seriesParts)\n            {\n                // Split on the LAST colon: the value list is colon-free, so the\n                // rightmost colon separates a (possibly colon-containing) series\n                // name from its values, e.g. \"Persons (Data year: 2021):1,2,3\".\n                var colonIdx = seriesPart.LastIndexOf(':');\n                if (colonIdx < 0) continue;\n                var name = seriesPart[..colonIdx].Trim();\n                var valStr = seriesPart[(colonIdx + 1)..].Trim();\n                if (string.IsNullOrEmpty(valStr))\n                    throw new ArgumentException($\"Series '{name}' has no data values. Expected format: 'Name:1,2,3'\");\n                var vals = ParseSeriesValues(valStr, name);\n                result.Add((name, vals));\n            }\n            return result;\n        }\n\n        for (int i = 1; i <= 20; i++)\n        {\n            // Read both keys up front so TrackingPropertyDictionary marks each\n            // consumed regardless of which branch supplies the values. Without\n            // this, `series{i}=` combined with `series{i}.name=` fell through\n            // to UNSUPPORTED + silent value drop (interview-edit R4 major).\n            var hasDotName = properties.TryGetValue($\"series{i}.name\", out var dotName);\n            var hasDotValues = properties.TryGetValue($\"series{i}.values\", out var dotValues);\n            var hasLegacy = properties.TryGetValue($\"series{i}\", out var legacyStr);\n\n            // Check for dotted syntax first: series1.name, series1.values\n            if (hasDotName || hasDotValues)","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Chart/ChartHelper.cs#L279-L315","documentation":"Thrown by ParseLiteralSeriesData (ChartHelper.cs:297) when a series part in a data= (or seriesN=) value contains a colon (so a name/value split is attempted) but the value substring after the last colon is empty. The split deliberately uses the LAST colon so colon-containing series names (e.g. 'Persons (Data year: 2021)') survive. A series with a name but no numbers is invalid.","triggerScenarios":"Setting data=Sales: or series1=Revenue: (name followed by colon and nothing), or data=A:;B:1,2 (first series empty). Also data=Name: (trailing colon after trimming whitespace).","commonSituations":"Building a data string with a trailing colon from a template; a series whose value list was dropped during copy-paste; splitting a spec and rejoining with a colon but forgetting the value half.","solutions":["Provide at least one comma-separated number after the colon: data=Sales:10,20,30.","If the series genuinely has no data, omit it entirely rather than emitting Name:.","Validate that each series part matches Name:v1,v2,... before submitting."],"exampleFix":"// before\ndata=Sales:\n// after\ndata=Sales:10,20,30","handlingStrategy":"validation","validationCode":"static string ValidateSeriesPart(string part)\n{\n    var idx = part.LastIndexOf(':');\n    if (idx < 0) return part;\n    var valStr = part[(idx+1)..].Trim();\n    if (string.IsNullOrEmpty(valStr)) throw new ArgumentException($\"series part '{part[..idx]}' has no values\");\n    return part;\n}","typeGuard":"static bool SeriesPartHasValues(string part)\n{\n    var idx = part.LastIndexOf(':');\n    return idx < 0 || !string.IsNullOrWhiteSpace(part[(idx+1)..]);\n}","tryCatchPattern":"try { /* add chart data=... */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"has no data values\"))\n{ /* drop empty series or supply values */ }","preventionTips":["Ensure every Name:values part has at least one number after the colon.","Omit a series entirely rather than emitting Name: with no values.","When joining dynamically, skip parts whose value list is empty."],"tags":["chart","series","data","validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}