Anvil: Web Apps with Nothing but Python Transcripts
Chapter: Charts and graphs
Lecture: Introducing charting in Anvil

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Because our application gathers a bunch of measurements, a really nice way to display these back to the user would be a chart.
0:08 That way they could quickly see what their weight or their health is over time. So that's what we're going to do in this chapter.
0:15 We're going to create some graphs, some charts right on the homepage. When people log in, just going to land there and see them.
0:22 But what are we going to use? Well, there's a lot of options in Python for building really rich, interactive plots in the web. One of those is Plotly.
0:31 So here's a really cool graph. You can see the life expectancy versus per capita GDP from 2007, and what's really nice is it's not just a picture.
0:41 You can move around this little red boxes when you hold the mouse over, I guess the part that's United States, and you can see the different colors
0:49 in areas and so on. And also, see that toolbar up at the top? You can zoom in, you can pan, you can do all kinds of stuff on these graphs
0:57 so they're very, very interactive. And in Anvil, it's super easy. All you have to do is go over to your toolbox
1:02 grab this little bar chart-looking thing bar graph-looking thing, and drag it over and then configure it, and it automatically
1:09 brings Plotly into your web app. So that's what we're going to do in this chapter for our weight and our resting heart rate.


Talk Python's Mastodon Michael Kennedy's Mastodon