Follow ______ on twitter.

2.3.1 Bar Charts

Code

Vega-Lite Chart

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A bar chart showing cyber security risks across departments",
  "width": 300,
  "height": 200,
  "data": {
    "values": [
      {
        "department": "HR",
        "risk": 30
      },
      {
        "department": "Finance",
        "risk": 25
      },
      {
        "department": "IT",
        "risk": 35
      },
      {
        "department": "Management",
        "risk": 15
      }
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "department",
      "type": "nominal",
      "axis": {
        "title": "Department"
      }
    },
    "y": {
      "field": "risk",
      "type": "quantitative",
      "axis": {
        "title": "Risk Level"
      }
    },
    "color": {
      "field": "department",
      "type": "nominal",
      "scale": {
        "scheme": "blues"
      }
    }
  },
  "title": "Distribution of Cyber Security Risks"
}