{"record":{"id":"412b42dfedaa26f2","repo":"iOfficeAI/OfficeCLI","slug":"invalid-ticklabelpos-value-value-valid-no","errorCode":null,"errorMessage":"Invalid 'tickLabelPos' value: '{value}'. Valid: none, high, low, nextTo.","messagePattern":"Invalid 'tickLabelPos' value: '(.+?)'\\. Valid: none, high, low, nextTo\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Chart/ChartHelper.Setter.cs","lineNumber":1869,"sourceCode":"                    var tickVal = ParseTickMark(value);\n                    foreach (var ax in plotArea2.Elements<C.ValueAxis>().Where(a => !IsDeletedAxis(a)))\n                    { ax.RemoveAllChildren<C.MinorTickMark>(); InsertAxisChildInOrder(ax, new C.MinorTickMark { Val = tickVal }); }\n                    foreach (var ax in plotArea2.Elements<C.CategoryAxis>().Where(a => !IsDeletedAxis(a)))\n                    { ax.RemoveAllChildren<C.MinorTickMark>(); InsertAxisChildInOrder(ax, new C.MinorTickMark { Val = tickVal }); }\n                    break;\n                }\n\n                case \"ticklabelpos\" or \"ticklabelposition\":\n                {\n                    var plotArea2 = chart.GetFirstChild<C.PlotArea>();\n                    if (plotArea2 == null) { unsupported.Add(key); break; }\n                    var tlPos = value.ToLowerInvariant() switch\n                    {\n                        \"none\" => C.TickLabelPositionValues.None,\n                        \"high\" or \"top\" => C.TickLabelPositionValues.High,\n                        \"low\" or \"bottom\" => C.TickLabelPositionValues.Low,\n                        \"nextto\" => C.TickLabelPositionValues.NextTo,\n                        _ => throw new ArgumentException($\"Invalid 'tickLabelPos' value: '{value}'. Valid: none, high, low, nextTo.\")\n                    };\n                    foreach (var ax in plotArea2.Elements<C.ValueAxis>().Where(a => !IsDeletedAxis(a)))\n                    { ax.RemoveAllChildren<C.TickLabelPosition>(); InsertAxisChildInOrder(ax, new C.TickLabelPosition { Val = tlPos }); }\n                    foreach (var ax in plotArea2.Elements<C.CategoryAxis>().Where(a => !IsDeletedAxis(a)))\n                    { ax.RemoveAllChildren<C.TickLabelPosition>(); InsertAxisChildInOrder(ax, new C.TickLabelPosition { Val = tlPos }); }\n                    break;\n                }\n\n                case \"axisposition\" or \"axispos\":\n                {\n                    var plotArea2 = chart.GetFirstChild<C.PlotArea>();\n                    if (plotArea2 == null) { unsupported.Add(key); break; }\n                    var axPos = value.ToLowerInvariant() switch\n                    {\n                        \"top\" or \"t\" => C.AxisPositionValues.Top,\n                        \"bottom\" or \"b\" => C.AxisPositionValues.Bottom,\n                        \"left\" or \"l\" => C.AxisPositionValues.Left,\n                        \"right\" or \"r\" => C.AxisPositionValues.Right,","sourceCodeStart":1851,"sourceCodeEnd":1887,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Chart/ChartHelper.Setter.cs#L1851-L1887","documentation":"Thrown when 'tickLabelPos'/'tickLabelPosition' does not match any switch arm. OOXML ST_TickLblPos is {none, high, low, nextTo}; the setter also accepts 'top' (high) and 'bottom' (low) aliases. Any other token is rejected rather than silently defaulted.","triggerScenarios":"SetChartProperties with { [\"tickLabelPos\"] = \"middle\" }, \"outside\", or a misspelled token.","commonSituations":"Generic 'outside'/'middle' vocabulary from another charting library; trailing whitespace or wrong case; copy from a config that used long-form 'nextTo' as 'next'.","solutions":["Use none, high (or top), low (or bottom), or nextTo.","Trim and ToLowerInvariant user input before passing.","Whitelist the value against the four schema values."],"exampleFix":"// before\nSetChartProperties(part, new() { [\"tickLabelPos\"] = \"outside\" });\n// after\nSetChartProperties(part, new() { [\"tickLabelPos\"] = \"nextTo\" });","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> TickLabelPos =\n    new[]{\"none\",\"high\",\"top\",\"low\",\"bottom\",\"nextto\"}, StringComparer.OrdinalIgnoreCase);\n\nstatic bool IsValidTickLabelPos(string v) =>\n    !string.IsNullOrWhiteSpace(v) && TickLabelPos.Contains(v.Trim().ToLowerInvariant());","typeGuard":"static bool IsKnownTickLabelPos(string v) =>\n    (v?.Trim().ToLowerInvariant()) is \"none\" or \"high\" or \"top\" or \"low\" or \"bottom\" or \"nextto\";","tryCatchPattern":"try { SetChartProperties(part, props); }\ncatch (ArgumentException ex) when (ex.Message.StartsWith(\"Invalid 'tickLabelPos'\"))\n{ /* default to nextTo and retry */ }","preventionTips":["Bind tick label position to the four schema values (none/high/low/nextTo).","Do not reuse labelPos vocabulary for tick labels.","Trim and lowercase free-text input."],"tags":["ooxml","chart","input-validation","axis","tick-labels","csharp"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}