import type { ChartLine } from "./ChartLine.js"; import type { ChartTextStyle } from "./ChartTextStyle.js"; import type { CrossBetween } from "./CrossBetween.js"; import type { DisplayUnits } from "./DisplayUnits.js"; import type { TickLabelPosition } from "./TickLabelPosition.js"; import type { TickMark } from "./TickMark.js"; /** * A chart category or value axis (`c:catAx`/`c:valAx`), distilled from * ooxmlsdk `CategoryAxis`/`ValueAxis` per `scripts/schema_diff.py`. * * Intentionally not modeled here (preserved on update, author via raw XML): * `spPr`/`txPr` styling (beyond `label_rotation`), `pictureOptions`, `extLst`, * multi-level category labels, and date-axis fields. * `min`/`max`/`major_unit`/`major_gridlines`/`number_format` are also surfaced * in the xlsx-preview renderer; the remainder round-trips for Excel. * * schema-excluded: spPr, auto, lblAlgn, lblOffset, tickLblSkip, tickMarkSkip, noMultiLvlLbl */ export type ChartAxisPatch = { title?: string; /** * `c:title/c:txPr/a:p/a:pPr/a:defRPr` axis-title font. Distinct from the * axis tick-label `c:txPr` (which is not modeled). Renderer-visible. */ titleFont?: ChartTextStyle; /** * `c:title/c:spPr` axis-title box solid fill: 6-hex `RRGGBB` / 8-hex * `AARRGGBB`, or the literal `"none"` for an explicit no-fill. */ titleFill?: string; /** * `c:title/c:spPr/a:ln` axis-title box border styling. */ titleBorder?: ChartLine; /** * Hide the axis entirely (`c:delete = 1`). */ hidden?: boolean; /** * `c:scaling/c:min`. */ min?: number; /** * `c:scaling/c:max`. */ max?: number; /** * `c:scaling/c:logBase` (2..=1000); value axis only. */ logBase?: number; /** * Reverse axis direction (`c:scaling/c:orientation = maxMin`). */ reversed?: boolean; /** * `c:majorUnit`; value axis only. */ majorUnit?: number; /** * `c:minorUnit`; value axis only. */ minorUnit?: number; majorGridlines?: boolean; minorGridlines?: boolean; majorTickMark?: TickMark; minorTickMark?: TickMark; tickLabelPosition?: TickLabelPosition; /** * `c:numFmt`. */ numberFormat?: string; /** * `c:crossBetween`; value axis only. */ crossBetween?: CrossBetween; /** * `c:crossesAt`. */ crossesAt?: number; /** * `c:dispUnits`; value axis only. A built-in unit name or custom divisor that * scales the value-axis labels. Renderer-visible. */ displayUnits?: DisplayUnits; /** * Tick-label rotation in whole degrees (-90..=90), stored as `c:txPr`'s * `a:bodyPr/@rot` in 60000ths of a degree. Round-trips for Excel; the * xlsx-preview renderer draws axis labels horizontally regardless. */ labelRotation?: number; /** * `c:catAx/c:txPr` (or `c:valAx/c:txPr`) tick-label font. Merged with * `label_rotation` into one `c:txPr`. Renderer-visible. */ labelFont?: ChartTextStyle; };