This website is for version 5. You can find the documentation for version 4 here.

Line Chart with Interpolation#

This chart shows a line chart with the path interpolated. A full list of interpolation methods is available in the documentation.

import altair as alt
from vega_datasets import data

source = data.stocks()

alt.Chart(source).mark_line(interpolate="monotone").encode(
    x="date:T",
    y="price:Q",
    color="symbol:N"
)
import altair as alt
from vega_datasets import data

source = data.stocks()

alt.Chart(source).mark_line(interpolate="monotone").encode(
    x="date:T",
    y="price:Q",
    color="symbol:N"
)
# No channel encoding options are specified in this chart
# so the code is the same as for the method-based syntax.