This document is adapted from the Area Charts section of the Altair Example Gallery.

Our first step is to set up our environment:

library("altair")
library("tibble")
library("jsonlite")

vega_data <- import_vega_data()

Horizon Graph

Altair example

This shows how a Horizon Graph with two layers. See this reference for more details on Horizon Graphs.

Chart

Interval Selection Example

Altair example

This is an example of creating a stacked chart for which the domain of the top chart can be selected by interacting with the bottom chart.

Chart

Layered Area Chart

Altair example

Chart

Normalized Stacked Area Chart

Altair example

Chart

Streamgraph

Altair example

Chart

Trellis Area Chart

Altair example

Chart

Trellis Area Sort Chart

Altair example

Chart