{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "charts",
  "status": "alpha",
  "import": "@senvenli/react/charts",
  "name": "area-chart",
  "title": "Area chart",
  "exports": [
    "AreaChart"
  ],
  "description": "A value over time as filled areas, one or several series, with a legend, tooltip and data table.",
  "keywords": [
    "chart",
    "area",
    "trend",
    "time series"
  ],
  "usage": {
    "when": [
      "A total and its trend over time."
    ],
    "instead": [
      {
        "use": "line-chart",
        "when": "Several series are compared, not summed."
      },
      {
        "use": "bar-chart",
        "when": "Periods are compared as discrete values."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Arrow left / right",
        "does": "Moves between data points; the tooltip follows."
      }
    ],
    "builtIn": [
      "A \"Show as table\" button shows the same data as a table, which screen readers get by default."
    ],
    "youProvide": [
      "A title that says what the figure is."
    ]
  },
  "related": [
    "line-chart",
    "bar-chart",
    "sparkline"
  ],
  "genui": {
    "expose": true,
    "description": "A trend over time. Rows are periods; categories are the numeric columns drawn (at most five).",
    "props": [
      "title",
      "period",
      "data",
      "index",
      "categories"
    ],
    "children": "none",
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "title": {
          "type": "string",
          "description": "What the chart shows (\"Revenue\"), over it; leave it out when a card or a heading already says so."
        },
        "period": {
          "type": "string",
          "description": "The period it covers (\"June–September 2026\")."
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          }
        },
        "index": {
          "type": "string",
          "description": "The x key: the period or category of each row."
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The series keys, in order; the first is the product's own figure (`ds-chart-1`)."
        }
      },
      "required": [
        "data",
        "index",
        "categories"
      ]
    }
  },
  "source": [
    "src/charts/core-charts.tsx"
  ],
  "props": {
    "AreaChart": [
      {
        "name": "title",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "What the chart shows (\"Revenue\"), over it; leave it out when a card or a heading already says so.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Names the chart when it has no visible `title` (a card's heading already says what it shows).",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "period",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The period it covers (\"June–September 2026\").",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "total",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "The headline figure, in `metric-medium` (\"€ 184,2k\")."
      },
      {
        "name": "data",
        "type": "readonly T[]",
        "required": true,
        "origin": "own",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          }
        }
      },
      {
        "name": "index",
        "type": "keyof T & string",
        "required": true,
        "origin": "own",
        "description": "The x key: the period or category of each row.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "categories",
        "type": "readonly (keyof T & string)[]",
        "required": true,
        "origin": "own",
        "description": "The series keys, in order; the first is the product's own figure (`ds-chart-1`).",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      {
        "name": "labels",
        "type": "Readonly<Partial<Record<string, string>>>",
        "required": false,
        "origin": "own",
        "description": "Series names by key (\"web\" → \"Website\"); the key by default."
      },
      {
        "name": "valueFormatter",
        "type": "ChartValueFormatter",
        "required": false,
        "origin": "own",
        "description": "Shared by axis, tooltip and table (Intl): \"€ 48.920\"."
      },
      {
        "name": "indexFormatter",
        "type": "(value: unknown) => string",
        "required": false,
        "origin": "own",
        "description": "The index label in the tooltip and the table (\"August 2026\")."
      },
      {
        "name": "indexLabel",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The index column's header in the data table; \"Period\" for time charts, \"Category\" for BarChart.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "height",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "The plot's height in px; 240 by default.",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "isLoading",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "emptyState",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "Shown instead of the plot when there is no data: an `EmptyState size=\"small\"` or text; \"No data\" by default."
      },
      {
        "name": "allowDecimals",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "`false` for whole counts (orders, new customers): the value axis steps by whole numbers, so a small count\nreads 0 / 1 / 2 / 3, never 0.7 / 1.4 / 2.1. Fractional steps by default. Percent bars keep their\n0–100% steps.",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "comparison",
        "type": "keyof T & string",
        "required": false,
        "origin": "own",
        "description": "The previous period's key: a dashed `ds-chart-neutral` line without fill.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "yAxisWidth",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "The value axis' width in px; by default wide enough for its longest tick (48–128px).",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "onValueChange",
        "type": "(row: T | null) => void",
        "required": false,
        "origin": "own",
        "description": "A pointer press on the chart: the row under it (keyboard users read values in the tooltip and the table)."
      }
    ]
  },
  "tokens": [
    "ds-background-neutral",
    "ds-border",
    "ds-border-bold",
    "ds-border-focused",
    "ds-chart-1",
    "ds-chart-2",
    "ds-chart-3",
    "ds-chart-4",
    "ds-chart-5",
    "ds-chart-neutral",
    "ds-link",
    "ds-radius-medium",
    "ds-radius-small",
    "ds-radius-xsmall",
    "ds-shadow-overlay",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-space-300",
    "ds-surface-overlay",
    "ds-surface-raised",
    "ds-text",
    "ds-text-danger",
    "ds-text-subtle",
    "ds-text-subtlest",
    "ds-text-success"
  ],
  "strings": [
    "chartCategory",
    "chartNoData",
    "chartPeriod",
    "hideDataTable",
    "selection",
    "showDataTable"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
