Skip to content
Vega-Lite templates

Physics — Chart: Planet Diameters

Relative diameters of the planets (Earth = 1).

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Planet diameters relative to Earth",
  "data": {"values": [
    {"planet": "Mercury", "d": 0.38},
    {"planet": "Venus", "d": 0.95},
    {"planet": "Earth", "d": 1.0},
    {"planet": "Mars", "d": 0.53},
    {"planet": "Jupiter", "d": 11.2},
    {"planet": "Saturn", "d": 9.4},
    {"planet": "Uranus", "d": 4.0},
    {"planet": "Neptune", "d": 3.9}
  ]},
  "mark": "bar",
  "encoding": {
    "x": {"field": "planet", "type": "nominal", "sort": null, "title": "Planet"},
    "y": {"field": "d", "type": "quantitative", "title": "diameter (Earth = 1)"},
    "color": {"field": "planet", "type": "nominal", "legend": null}
  }
}