{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://chartbuddy.io/schema/chart-data.json",
  "title": "ChartBuddy chart data",
  "description": "Config object accepted by @chartbuddy.io/embed. GENERATED from the chart schema registry — do not edit by hand.",
  "type": "object",
  "required": [
    "chartType",
    "seriesData"
  ],
  "properties": {
    "chartType": {
      "description": "Chart type. Aliases are normalized to canonical types. Deprecated aliases are still accepted at runtime but omitted here so generated configs use current names.",
      "type": "string",
      "enum": [
        "area",
        "area100",
        "barMekko",
        "bubble",
        "clusteredBar",
        "combo",
        "donut",
        "line",
        "mekko",
        "pie",
        "scatter",
        "stackedBar",
        "stackedBar100",
        "waterfall"
      ]
    },
    "seriesData": {
      "description": "2D data grid. Required layout depends on chartType — see chartTypes metadata.",
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "array",
        "items": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        }
      }
    },
    "id": {
      "type": "string"
    },
    "version": {
      "description": "App version the config was last migrated to. Drives the migrators.",
      "type": "string"
    },
    "title": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "visible": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        },
        "fontFamily": {
          "type": "string"
        },
        "fontSize": {
          "type": "number",
          "minimum": 0
        },
        "fontColor": {
          "type": "string"
        },
        "backgroundColor": {
          "type": "string"
        },
        "textAlign": {
          "type": "string"
        },
        "width": {
          "type": "number",
          "minimum": 0
        },
        "height": {
          "type": "number",
          "minimum": 0
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "movable": {
          "type": "boolean"
        },
        "deletable": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "subtitle": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "visible": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        },
        "fontFamily": {
          "type": "string"
        },
        "fontSize": {
          "type": "number",
          "minimum": 0
        },
        "fontColor": {
          "type": "string"
        },
        "backgroundColor": {
          "type": "string"
        },
        "textAlign": {
          "type": "string"
        },
        "width": {
          "type": "number",
          "minimum": 0
        },
        "height": {
          "type": "number",
          "minimum": 0
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "movable": {
          "type": "boolean"
        },
        "deletable": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "footnote": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "visible": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        },
        "fontFamily": {
          "type": "string"
        },
        "fontSize": {
          "type": "number",
          "minimum": 0
        },
        "fontColor": {
          "type": "string"
        },
        "backgroundColor": {
          "type": "string"
        },
        "textAlign": {
          "type": "string"
        },
        "width": {
          "type": "number",
          "minimum": 0
        },
        "height": {
          "type": "number",
          "minimum": 0
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "movable": {
          "type": "boolean"
        },
        "deletable": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "isDataTransposed": {
      "description": "When true (default), seriesData rows are series.",
      "type": "boolean"
    },
    "seriesDataSource": {},
    "orientation": {
      "type": "string",
      "enum": [
        "vertical",
        "horizontal"
      ]
    },
    "backgroundColor": {
      "description": "CSS color.",
      "type": "string"
    },
    "canvas": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number",
          "minimum": 0
        },
        "height": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": true
    },
    "chartPositionPercentages": {
      "type": "object",
      "properties": {
        "left": {
          "type": "number"
        },
        "right": {
          "type": "number"
        },
        "top": {
          "type": "number"
        },
        "bottom": {
          "type": "number"
        }
      },
      "additionalProperties": true
    },
    "legend": {
      "type": "object",
      "properties": {
        "visible": {
          "type": "boolean"
        },
        "colors": {
          "type": "array",
          "items": {
            "description": "CSS color.",
            "type": "string"
          }
        },
        "position": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "axes": {
      "description": "Axes keyed by physical side (left/right/top/bottom).",
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "axisTitle": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "visible": {
                "type": "boolean"
              },
              "text": {
                "type": "string"
              },
              "fontFamily": {
                "type": "string"
              },
              "fontSize": {
                "type": "number",
                "minimum": 0
              },
              "fontColor": {
                "type": "string"
              },
              "backgroundColor": {
                "type": "string"
              },
              "textAlign": {
                "type": "string"
              },
              "width": {
                "type": "number",
                "minimum": 0
              },
              "height": {
                "type": "number",
                "minimum": 0
              },
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "movable": {
                "type": "boolean"
              },
              "deletable": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "gridlines": {
            "type": "object",
            "properties": {
              "visible": {
                "type": "boolean"
              },
              "color": {
                "description": "CSS color.",
                "type": "string"
              },
              "width": {
                "type": "number",
                "minimum": 0
              },
              "dashArray": {
                "type": "string"
              },
              "opacity": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "overrides": {
                "description": "Per-index overrides; keys are indices, values are style patches.",
                "type": "object",
                "additionalProperties": {}
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      }
    },
    "annotations": {
      "type": "object",
      "properties": {
        "cagrs": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        },
        "differenceArrows": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        },
        "levelArrows": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        },
        "levelLines": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "seriesLabels": {
      "type": "object",
      "properties": {
        "visible": {
          "type": "boolean"
        },
        "fontSize": {
          "type": "number",
          "minimum": 0
        },
        "fontColor": {
          "description": "CSS color.",
          "type": "string"
        },
        "fontFamily": {
          "type": "string"
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "multilines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "deletable": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "additionalProperties": true
      }
    },
    "origin": {
      "type": "object",
      "additionalProperties": true
    },
    "area": {
      "description": "Options for chart types whose optionBag is \"area\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "width": {
          "type": "number",
          "minimum": 0
        },
        "strokeDashArray": {
          "type": "string"
        },
        "drawPoints": {
          "type": "boolean"
        },
        "curveType": {
          "type": "string",
          "enum": [
            "linear",
            "cardinal",
            "step",
            "basis",
            "monotone"
          ]
        },
        "curveParameter": {
          "type": "number"
        },
        "shadowIntensity": {
          "type": "number",
          "minimum": 0
        },
        "fillOpacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "fillType": {
          "type": "string",
          "enum": [
            "solid",
            "gradient"
          ]
        },
        "fillOpacityTop": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "fillOpacityBottom": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "gradientTarget": {
          "type": "string"
        },
        "strokeOpacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "pointMarker": {
          "type": "object",
          "properties": {
            "shape": {
              "type": "string",
              "enum": [
                "circle",
                "square",
                "diamond",
                "triangle"
              ]
            },
            "radius": {
              "description": "Radius in px.",
              "type": "number",
              "minimum": 0
            },
            "fill": {
              "description": "CSS color; null derives it from the series color.",
              "type": [
                "string",
                "null"
              ]
            },
            "stroke": {
              "description": "CSS color.",
              "type": "string"
            },
            "strokeWidth": {
              "type": "number",
              "minimum": 0
            },
            "strokeDashArray": {
              "type": "string"
            },
            "series": {
              "description": "Per-index overrides; keys are indices, values are style patches.",
              "type": "object",
              "additionalProperties": {}
            },
            "overrides": {
              "description": "Per-index overrides; keys are indices, values are style patches.",
              "type": "object",
              "additionalProperties": {}
            }
          },
          "additionalProperties": true
        },
        "dataLabels": {
          "type": "object",
          "properties": {
            "overrides": {
              "description": "Per-index overrides; keys are indices, values are style patches.",
              "type": "object",
              "additionalProperties": {}
            }
          },
          "additionalProperties": true
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "bar": {
      "description": "Options for chart types whose optionBag is \"bar\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "padding": {
          "description": "Gap between bars, 0–1.",
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "cornerRadius": {
          "type": "number",
          "minimum": 0
        },
        "reverseStackOrder": {
          "type": "boolean"
        },
        "seriesStrokes": {
          "type": "array",
          "items": {
            "description": "CSS color; null derives it from the series color.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "seriesStrokeWidths": {
          "type": "array",
          "items": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        },
        "seriesStrokeDashArrays": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "series": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "barMekko": {
      "description": "Options for chart types whose optionBag is \"barMekko\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "sort": {
          "description": "Column order along the width axis.",
          "type": "string",
          "enum": [
            "heightDesc",
            "heightAsc",
            "widthDesc",
            "widthAsc",
            "dataOrder",
            "desc",
            "asc"
          ]
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "combo": {
      "description": "Options for chart types whose optionBag is \"combo\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "seriesTypes": {
          "description": "Per-series render type, keyed by series index.",
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "enum": [
              "bar",
              "line",
              "area"
            ]
          }
        },
        "baseChartType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "clusteredBar",
            "stackedBar",
            null
          ]
        }
      },
      "additionalProperties": true
    },
    "line": {
      "description": "Options for chart types whose optionBag is \"line\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "width": {
          "description": "Stroke width in px.",
          "type": "number",
          "minimum": 0
        },
        "strokeDashArray": {
          "type": "string"
        },
        "drawPoints": {
          "type": "boolean"
        },
        "curveType": {
          "type": "string",
          "enum": [
            "linear",
            "cardinal",
            "step",
            "basis",
            "monotone"
          ]
        },
        "curveParameter": {
          "type": "number"
        },
        "shadowIntensity": {
          "type": "number",
          "minimum": 0
        },
        "padding": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "pointMarker": {
          "type": "object",
          "properties": {
            "shape": {
              "type": "string",
              "enum": [
                "circle",
                "square",
                "diamond",
                "triangle"
              ]
            },
            "radius": {
              "description": "Radius in px.",
              "type": "number",
              "minimum": 0
            },
            "fill": {
              "description": "CSS color; null derives it from the series color.",
              "type": [
                "string",
                "null"
              ]
            },
            "stroke": {
              "description": "CSS color.",
              "type": "string"
            },
            "strokeWidth": {
              "type": "number",
              "minimum": 0
            },
            "strokeDashArray": {
              "type": "string"
            },
            "series": {
              "description": "Per-index overrides; keys are indices, values are style patches.",
              "type": "object",
              "additionalProperties": {}
            },
            "overrides": {
              "description": "Per-index overrides; keys are indices, values are style patches.",
              "type": "object",
              "additionalProperties": {}
            }
          },
          "additionalProperties": true
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "mekko": {
      "description": "Options for chart types whose optionBag is \"mekko\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "showTotals": {
          "description": "Legacy fallback for charts predating annotations.totals.visible.",
          "type": "boolean"
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "pie": {
      "description": "Options for chart types whose optionBag is \"pie\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "innerRadiusRatio": {
          "description": "0 is a full pie; the donut alias seeds 0.5.",
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "scaleFactor": {
          "type": "number",
          "minimum": 0
        },
        "labelVisibilityThreshold": {
          "type": "number",
          "minimum": 0
        },
        "explode": {
          "description": "Per-slice explode offsets.",
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "line": {
          "type": "object",
          "properties": {
            "color": {
              "description": "CSS color.",
              "type": "string"
            },
            "width": {
              "type": "number",
              "minimum": 0
            },
            "dashArray": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "seriesStrokes": {
          "type": "array",
          "items": {
            "description": "CSS color; null derives it from the series color.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "seriesStrokeWidths": {
          "type": "array",
          "items": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        },
        "seriesStrokeDashArrays": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "scatter": {
      "description": "Options for chart types whose optionBag is \"scatter\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "diameter": {
          "description": "Marker diameter in px. The bubble alias seeds a larger default.",
          "type": "number",
          "minimum": 0
        },
        "shape": {
          "type": "string"
        },
        "shapes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "seriesStrokes": {
          "type": "array",
          "items": {
            "description": "CSS color; null derives it from the series color.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "seriesStrokeWidths": {
          "type": "array",
          "items": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        },
        "seriesStrokeDashArrays": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    },
    "waterfall": {
      "description": "Options for chart types whose optionBag is \"waterfall\" — see x-chartbuddy.chartTypes.",
      "type": "object",
      "properties": {
        "totalBarColor": {
          "description": "CSS color.",
          "type": "string"
        },
        "totalLegendLabel": {
          "type": "string"
        },
        "seriesStrokes": {
          "type": "array",
          "items": {
            "description": "CSS color; null derives it from the series color.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "seriesStrokeWidths": {
          "type": "array",
          "items": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        },
        "connectorOverrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        },
        "columns": {
          "description": "Per-column structural metadata. Keys are 0-based DATA column indices: positions in the header row after the row-label cell, not indices into the raw seriesData row. Column 0 is always a start bar.",
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "isTotal": {
                "description": "Show the running total here. The column contributes nothing and its own value is ignored, so leave the cell empty rather than computing a closing figure yourself.",
                "type": "boolean"
              },
              "startBar": {
                "description": "Begin a new sequence from zero with no connector from the previous column. A mid-chart opening bar needs isTotal: true as well.",
                "type": "boolean"
              },
              "showSegments": {
                "description": "Render a total as per-series segments instead of one solid bar.",
                "type": "boolean"
              }
            },
            "additionalProperties": true
          }
        },
        "overrides": {
          "description": "Per-index overrides; keys are indices, values are style patches.",
          "type": "object",
          "additionalProperties": {}
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true,
  "x-chartbuddy": {
    "aliases": {
      "bubble": "scatter",
      "donut": "pie"
    },
    "deprecatedAliases": [],
    "chartTypes": {
      "area": {
        "label": "Area Chart",
        "description": "Filled lines showing magnitude over an ordered domain.",
        "optionBag": "area",
        "family": "area",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "area100": {
        "label": "100% Area Chart",
        "description": "Area chart normalized to 100% to show changing mix.",
        "optionBag": "area",
        "family": "area",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "barMekko": {
        "label": "Bar Mekko",
        "description": "Bars whose width encodes one metric and height another; first data row sets widths.",
        "optionBag": "barMekko",
        "family": "mekko",
        "seriesLayout": "widthRowThenHeightRows",
        "seriesLayoutDescription": "row 1 sizes the bars (never drawn); rows 2+ are stacked height segments",
        "minRows": 3,
        "minCols": 2,
        "status": "stable"
      },
      "clusteredBar": {
        "label": "Clustered Bar",
        "description": "Side-by-side bars comparing series within each category.",
        "optionBag": "bar",
        "family": "bar",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "combo": {
        "label": "Combo Chart",
        "description": "Mixed bar and line series on shared or dual axes.",
        "optionBag": "combo",
        "family": "combo",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "line": {
        "label": "Line Chart",
        "description": "Trends over an ordered domain, one line per series.",
        "optionBag": "line",
        "family": "line",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "mekko": {
        "label": "Marimekko",
        "description": "Variable-width stacked bars where both axes are percentages.",
        "optionBag": "mekko",
        "family": "mekko",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "pie": {
        "label": "Pie Chart",
        "description": "Share of a single total across categories.",
        "optionBag": "pie",
        "family": "pie",
        "seriesLayout": "categoryValue",
        "seriesLayoutDescription": "two columns per row: [Category, Value]",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "scatter": {
        "label": "Scatter Plot",
        "description": "Points positioned by two metrics, optionally sized and grouped.",
        "optionBag": "scatter",
        "family": "scatter",
        "seriesLayout": "pointRows",
        "seriesLayoutDescription": "row 0 names the metrics; each later row is one point",
        "minRows": 2,
        "minCols": 3,
        "status": "stable"
      },
      "stackedBar": {
        "label": "Stacked Bar",
        "description": "Bars stacked to show composition and category totals.",
        "optionBag": "bar",
        "family": "bar",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "stackedBar100": {
        "label": "100% Stacked Bar",
        "description": "Stacked bars normalized to 100% to compare mix, not size.",
        "optionBag": "bar",
        "family": "bar",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      },
      "waterfall": {
        "label": "Waterfall",
        "description": "Running total showing how contributions bridge two values.",
        "optionBag": "waterfall",
        "family": "waterfall",
        "seriesLayout": "seriesRows",
        "seriesLayoutDescription": "row 0 is the category header; each later row is one series",
        "minRows": 2,
        "minCols": 2,
        "status": "stable"
      }
    }
  }
}
