Bar chart with line at mean

Source code Author

using Deneb

data = Data(url="https://vega.github.io/vega-datasets/data/wheat.json")

bar = Mark(:bar) * Encoding("year:O", "wheat:Q")

rule = Mark(:rule, color=:red) * Encoding(y="mean(wheat):Q")

chart = data * (bar + rule) * vlspec(width=600)

This page was generated using DemoCards.jl and Literate.jl.