Portal Community

Minimal Example

{
  "id": "monthly-sales",
  "type": "chart-bar",
  "label": "Monthly Sales",
  "width": "full",
  "settings": {
    "height": "300px",
    "binding": {
      "source": "$context",
      "path": "report.monthlySales"
    }
  }
}

// Data shape expected:
// [{ "label": "Jan", "value": 12500 }, { "label": "Feb", "value": 18200 }, ...]

Settings Reference

SettingTypeDefaultDescription
orientationvertical | horizontalverticalBar direction
modegrouped | stackedgroupedHow multi-series bars are rendered
seriesKeystring"value"Property name for the value in single-series data
labelKeystring"label"Property name for the category label
seriesSeriesDef[]Multi-series configuration (key + label for each series)
showDataLabelsbooleanfalseShow value labels on top of each bar
barWidthstring (CSS %)"60%"Width of each bar relative to category width
chartConfig.xAxisobjectX axis: label, tickRotation, format
chartConfig.yAxisobjectY axis: label, format (currency/number), min, max

Grouped Multi-Series Bar Chart

{
  "id": "revenue-comparison",
  "type": "chart-bar",
  "settings": {
    "height": "350px",
    "title": "Revenue vs Target by Quarter",
    "mode": "grouped",
    "labelKey": "quarter",
    "series": [
      { "key": "actual",  "label": "Actual Revenue" },
      { "key": "target",  "label": "Target Revenue" }
    ],
    "colors": ["#6c8cff", "#22c55e"],
    "chartConfig": {
      "yAxis": { "label": "USD", "format": "currency" }
    },
    "binding": { "source": "$context", "path": "report.quarterly" }
  }
}

// Data shape:
// [
//   { "quarter": "Q1 2025", "actual": 145000, "target": 130000 },
//   { "quarter": "Q2 2025", "actual": 162000, "target": 145000 }
// ]

Horizontal Bar Chart

{
  "id": "top-products",
  "type": "chart-bar",
  "settings": {
    "orientation": "horizontal",
    "title": "Top Products by Revenue",
    "showDataLabels": true,
    "height": "280px",
    "chartConfig": {
      "xAxis": { "label": "Revenue ($)", "format": "currency" },
      "yAxis": { "label": "Product" }
    },
    "binding": { "source": "$context", "path": "report.topProducts" }
  }
}

Stacked Bar Chart

{
  "id": "cost-breakdown",
  "type": "chart-bar",
  "settings": {
    "mode": "stacked",
    "title": "Cost Breakdown by Department",
    "labelKey": "month",
    "series": [
      { "key": "staffing", "label": "Staffing" },
      { "key": "infra",    "label": "Infrastructure" },
      { "key": "software", "label": "Software" }
    ],
    "binding": { "source": "$context", "path": "costs.byDepartment" }
  }
}