{"record":{"id":"c17e6a7d98001140","repo":"iOfficeAI/OfficeCLI","slug":"invalid-ticklabelskip-value-value-must-be","errorCode":null,"errorMessage":"Invalid 'tickLabelSkip' value: '{value}'. Must be an integer 1..65535 (OOXML ST_Skip).","messagePattern":"Invalid 'tickLabelSkip' value: '(.+?)'\\. Must be an integer 1\\.\\.65535 \\(OOXML ST_Skip\\)\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Chart/ChartHelper.Axis.cs","lineNumber":615,"sourceCode":"                    if (normalizedRole != \"category\") { directlyHandled.Add(key); break; }\n                    if (targetAxis is OpenXmlCompositeElement axLo)\n                    {\n                        axLo.RemoveAllChildren<C.LabelOffset>();\n                        axLo.AppendChild(new C.LabelOffset { Val = (ushort)ParseHelpers.SafeParseInt(value, \"labelOffset\") });\n                    }\n                    directlyHandled.Add(key);\n                    break;\n                }\n\n                case \"ticklabelskip\":\n                case \"tickskip\":\n                {\n                    if (normalizedRole != \"category\") { directlyHandled.Add(key); break; }\n                    if (targetAxis is OpenXmlCompositeElement axTls)\n                    {\n                        var tlsVal = ParseHelpers.SafeParseInt(value, \"tickLabelSkip\");\n                        if (tlsVal < 1 || tlsVal > 65535)\n                            throw new ArgumentException($\"Invalid 'tickLabelSkip' value: '{value}'. Must be an integer 1..65535 (OOXML ST_Skip).\");\n                        axTls.RemoveAllChildren<C.TickLabelSkip>();\n                        axTls.AppendChild(new C.TickLabelSkip { Val = tlsVal });\n                    }\n                    directlyHandled.Add(key);\n                    break;\n                }\n\n                case \"crossbetween\":\n                {\n                    // Schema: crossBetween only valid on value/value2; on category/series ignore.\n                    if (normalizedRole is not (\"value\" or \"value2\")) { directlyHandled.Add(key); break; }\n                    if (targetAxis is OpenXmlCompositeElement axCb)\n                    {\n                        axCb.RemoveAllChildren<C.CrossBetween>();\n                        var cbVal = value.ToLowerInvariant() switch\n                        {\n                            \"midcat\" or \"midpoint\" => C.CrossBetweenValues.MidpointCategory,\n                            _ => C.CrossBetweenValues.Between","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Chart/ChartHelper.Axis.cs#L597-L633","documentation":"The tickLabelSkip setter applies to category axes only (normalizedRole == 'category'). The value is parsed as an integer via SafeParseInt, then range-checked against OOXML ST_Skip: must be 1..65535. A value outside this range is invalid in the schema and would produce a corrupt file. The element is then created as C.TickLabelSkip.","triggerScenarios":"Setting ticklabelskip or tickskip (alias) to a non-integer or out-of-range value: ticklabelskip=0, ticklabelskip=-1, ticklabelskip=70000, or ticklabelskip=abc. Only fires for the 'category' axis role.","commonSituations":"Using 0 (which would mean 'skip all labels' — not valid; use 1 for 'show all'). Using a very large value that exceeds the 16-bit unsigned range. Using a non-integer value. Applying to a value axis (silently ignored, does not throw).","solutions":["Use an integer in 1..65535: ticklabelskip=2 (show every 2nd label).","Use 1 to show every category label (no skipping).","Note: this only works on category axes — for value axes, it is silently ignored."],"exampleFix":"// before\nticklabelskip=0\n// after\nticklabelskip=2\n// show every other category label","handlingStrategy":"validation","validationCode":"static bool IsValidTickLabelSkip(string value)\n{\n    if (!int.TryParse(value, out var tlsVal)) return false;\n    return tlsVal >= 1 && tlsVal <= 65535;\n}","typeGuard":null,"tryCatchPattern":"try { axisSetter.Apply(\"ticklabelskip\", value); }\ncatch (ArgumentException ex) when (ex.Message.StartsWith(\"Invalid 'tickLabelSkip'\"))\n{\n    Console.Error.WriteLine($\"{ex.Message}\\nMust be an integer 1..65535.\");\n}","preventionTips":["Use an integer in the 1–65535 range for tickLabelSkip.","Use 1 to show all labels (no skipping).","Validate that the value is a parseable integer in range before applying."],"tags":["chart","axis","tick-label-skip","range-check","ooxml-schema"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}