{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://usechartory.com/schemas/waterfall.json",
 "description": "The data prop of <Waterfall> (Chartory chart 042).",
 "type": "object",
 "title": "WaterfallData",
 "properties": {
  "max": {
   "type": "number",
   "description": "The top of the value scale."
  },
  "ticks": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "The axis tick labels."
  },
  "fmt": {
   "x-function": "(v: number) => string",
   "description": "A function, so not JSON: pass it in code."
  },
  "steps": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "WaterfallStep",
    "properties": {
     "label": {
      "type": "string",
      "description": "The name shown on the chart."
     },
     "v": {
      "type": "number",
      "description": "The value."
     },
     "total": {
      "type": "boolean",
      "description": "Draws the bar up from zero, as a total."
     }
    },
    "required": [
     "label",
     "v"
    ]
   },
   "description": "One entry per step."
  },
  "stagger": {
   "anyOf": [
    {
     "type": "boolean"
    },
    {
     "enum": [
      "auto"
     ]
    }
   ],
   "description": "Step names wider than their column: every other one on a second row (the plot's base rises one row). \"auto\"\n(site cards with long names): one row, or two when two names would touch, so no x label is ever dropped."
  }
 },
 "required": [
  "max",
  "ticks",
  "steps"
 ]
}
