Line Chart with Cumulative Sum

This chart creates a simple line chart from the cumulative sum of a fields.

import altair as alt
from vega_datasets import data

source = data.wheat()

    # Sort the data chronologically
    sort=[{'field': 'year'}],
    # Include all previous records before the current record and none after
    # (This is the default value so you could skip it and it would still work.)
    frame=[None, 0],
    # What to add up as you go
    # Plot the calculated field created by the transformation