Skip to main content
100%

Vega(Lite)

✓ Published0🌍 Public
EEleonore9
Last edited Jul 25, 2018
Created on Feb 22, 2018

This example shows a horizontal bar chart of six test data points (element 1 through 6 with values 4, 8, 15, 16, 23, and 42), with the bars extending rightward from the y-axis. The visualization is built using Vega-Lite’s JSON declarative grammar, embedded inline in the page. The chart renders as an SVG via `vegaEmbed`, and the code loads Vega, Vega-Lite, and Vega-Embed from CDNs, then enhances the chart with tooltips using `vegaTooltip.vegaLite` on mouseover.

AI-generated description

Viz playground - basic data viz with Vega

Link

bl.ocks.org/Eleonore9/0a759cc56022e40930530f32a0d92525

Content

Bar chart made with Vega-Lite for a blog post.

Vega-Lite is a simple JSON like grammar to create (interactive) data visualisations.

The data used is only testing data added to the script:

"data": {
            "values": [{"element": 1, "value": 4},
	               {"element": 2, "value": 8},
	               {"element": 3, "value": 15},
	               {"element": 4, "value": 16},
	               {"element": 5, "value": 23},
	               {"element": 6, "value": 42}]
	  }

Similar vizzes