{"record":{"id":"9d9617dc040b4882","repo":"iOfficeAI/OfficeCLI","slug":"invalid-tick-mark-value-value-valid-values-n","errorCode":null,"errorMessage":"Invalid tick mark value '{value}'. Valid values: none, in, out, cross.","messagePattern":"Invalid tick mark value '(.+?)'\\. Valid values: none, in, out, cross\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Chart/ChartHelper.SetterHelpers.cs","lineNumber":57,"sourceCode":"            \"topright\" or \"tr\" => C.LegendPositionValues.TopRight,\n            _ => throw new ArgumentException(\n                $\"Invalid legend position '{value}'. \" +\n                \"Valid: none, top, bottom, left, right, topRight \" +\n                \"(or use 'none'/'false' to hide the legend).\"),\n        };\n    }\n\n    // ==================== Tick Mark Helpers ====================\n\n    internal static C.TickMarkValues ParseTickMark(string value)\n    {\n        return value.ToLowerInvariant() switch\n        {\n            \"none\" or \"false\" => C.TickMarkValues.None,\n            \"in\" or \"inside\" => C.TickMarkValues.Inside,\n            \"out\" or \"outside\" => C.TickMarkValues.Outside,\n            \"cross\" or \"both\" => C.TickMarkValues.Cross,\n            _ => throw new ArgumentException(\n                $\"Invalid tick mark value '{value}'. Valid values: none, in, out, cross.\")\n        };\n    }\n\n    // ==================== Trendline Helpers ====================\n\n    internal static C.Trendline BuildTrendline(string spec)\n    {\n        // Format: \"type\" or \"type:order\" or \"type:forward:backward\"\n        // e.g. \"linear\", \"poly:3\", \"exp:2:1\", \"movingAvg:3\"\n        var parts = spec.Split(':');\n        var typeStr = parts[0].Trim().ToLowerInvariant();\n\n        var trendline = new C.Trendline();\n\n        var trendType = typeStr switch\n        {\n            \"linear\" => C.TrendlineValues.Linear,","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Chart/ChartHelper.SetterHelpers.cs#L39-L75","documentation":"Thrown by ParseTickMark (ChartHelper.SetterHelpers.cs:57) when a tick-mark string does not match none/false, in/inside, out/outside, or cross/both. Unlike legend parsing, this method only applies ToLowerInvariant (no SchemaKeyNormalizer), so separator variants and abbreviations are not normalized. The error lists the four canonical values in the message.","triggerScenarios":"Setting a tick-mark property (e.g. majorTickMark, minorTickMark) to a token outside none/in/out/cross and their aliases, e.g. 'inside-out', 'full', 'middle', 'center', 'internal'.","commonSituations":"Translating Excel's 'Inside'/'Outside'/'Cross' UI wording but guessing a non-alias token like 'internal' or 'middle'; passing 'IN' works (lowercased) but 'in-out' does not since no separator normalization happens here.","solutions":["Use one of: none, in, out, cross (aliases: inside, outside, both, false).","Do not rely on dash/underscore normalization for tick marks — pass the bare token."],"exampleFix":"// before\nmajorTickMark=inside-out\n// after\nmajorTickMark=in","handlingStrategy":"validation","validationCode":"static readonly Dictionary<string,string> TickMarks = new(StringComparer.OrdinalIgnoreCase)\n{ [\"none\"]=\"none\",[\"false\"]=\"none\",[\"in\"]=\"in\",[\"inside\"]=\"in\",[\"out\"]=\"out\",[\"outside\"]=\"out\",[\"cross\"]=\"cross\",[\"both\"]=\"cross\" };\nstatic string ResolveTickMark(string v) => TickMarks.TryGetValue((v ?? \"\").Trim(), out var t) ? t : throw new ArgumentException($\"invalid tick mark '{v}'\");","typeGuard":"static bool IsValidTickMark(string v) => TickMarks.ContainsKey((v ?? \"\").Trim());","tryCatchPattern":"try { /* set chart majorTickMark=... */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Invalid tick mark value\"))\n{ /* list: none, in, out, cross */ }","preventionTips":["Tick marks are NOT separator-normalized — pass bare tokens (no dashes).","Lowercase the value before setting.","Map Excel UI 'Inside/Outside/Cross' to in/out/cross explicitly."],"tags":["chart","axis","tickmark","validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}