THE ONE LAYER · DATAVIZ

Projects by Category

Distribution of 3D print builds across project types.

← BACK_TO_GALLERY

$ RENDER_CHART --type=bar --source=categories.json


SPEC_BREAKDOWN

What this chart teaches


mark: "bar"
The simplest mark. Vega-Lite infers a grouped bar chart from the nominal x + quantitative y combo.
encoding.x - nominal
Field type nominal means discrete, unordered categories. Vega-Lite draws one bar per unique value.
sort: "-y"
Sorts bars by the y-axis field in descending order. Makes the tallest bar appear first, improving readability.
color.scale.range
Custom palette array. Each category gets a colour from the array in order. legend: null hides the default legend since the x-axis already labels the bars.
mark.cornerRadiusEnd
Rounds the top corners of each bar - a cosmetic property on the mark object.