Skip to content
Vega-Lite templates

Chemistry — Chart: Reactivity Series

Relative reactivity of common metals.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Relative reactivity of metals",
  "data": {"values": [
    {"metal": "Potassium", "rank": 10},
    {"metal": "Sodium", "rank": 9},
    {"metal": "Calcium", "rank": 8},
    {"metal": "Magnesium", "rank": 7},
    {"metal": "Zinc", "rank": 5},
    {"metal": "Iron", "rank": 4},
    {"metal": "Copper", "rank": 2},
    {"metal": "Gold", "rank": 1}
  ]},
  "mark": "bar",
  "encoding": {
    "y": {"field": "metal", "type": "nominal", "sort": "-x", "title": "Metal"},
    "x": {"field": "rank", "type": "quantitative", "title": "relative reactivity"},
    "color": {"field": "rank", "type": "quantitative", "scale": {"scheme": "reds"}}
  }
}