altair logo altair: json

1 2 3 4 5 6 7 8 9
Notes

You can call .to_json and .to_html on any chart that you've defined to get the json or html out.

p1 = (alt.Chart(plot_df)
  .mark_line()
  .encode(x='date', y='births', color=alt.Color('wday', sort=days))
  .properties(width=125, height=125)
  .interactive())

print(p1.to_html())
print(p1.to_json())