Skip to main content
Bar chart with one or more series.
{
  "type": "object",
  "properties": {
    "type": {
      "const": "BarChart",
      "default": "BarChart",
      "type": "string"
    },
    "id": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "HTML id attribute for CSS targeting. Applied to the outermost element."
    },
    "cssClass": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "CSS/Tailwind classes for styling. Accepts a Responsive() for breakpoint-aware classes."
    },
    "data": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "string"
        }
      ],
      "description": "Row data or `{{ interpolation }}` reference"
    },
    "series": {
      "description": "Series to render as bars",
      "items": {
        "$ref": "ChartSeries"
      },
      "type": "array"
    },
    "xAxis": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Data key for x-axis labels"
    },
    "height": {
      "default": 300,
      "description": "Chart height in pixels",
      "type": "integer"
    },
    "stacked": {
      "default": false,
      "description": "Stack bars",
      "type": "boolean"
    },
    "horizontal": {
      "default": false,
      "description": "Render as horizontal bar chart",
      "type": "boolean"
    },
    "barRadius": {
      "default": 4,
      "description": "Corner radius on bars",
      "type": "integer"
    },
    "showLegend": {
      "default": false,
      "description": "Show legend",
      "type": "boolean"
    },
    "showTooltip": {
      "default": true,
      "description": "Show tooltip on hover",
      "type": "boolean"
    },
    "showGrid": {
      "default": true,
      "description": "Show cartesian grid",
      "type": "boolean"
    },
    "showYAxis": {
      "default": true,
      "description": "Show y-axis with tick labels",
      "type": "boolean"
    },
    "yAxisFormat": {
      "default": "auto",
      "description": "Y-axis tick format: 'compact' shows 60K instead of 60000",
      "enum": [
        "auto",
        "compact"
      ],
      "type": "string"
    }
  },
  "required": [
    "type",
    "data",
    "series"
  ]
}