Anvil: Web Apps with Nothing but Python Transcripts
Chapter: Charts and graphs
Lecture: Concept: Plotting int anvil

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's just quickly review the two main steps of what we did to set up our chart and then put data into it. Well, first we set it up
0:08 and we did that by just setting a ton of properties. We went to the layout, and we did a bunch of stuff with layouts at the title, and the X-axis
0:15 and the Y-axis and so on. And on the X-axis, we have a bunch of properties like the zero line or show the grid
0:21 or mirror should be ticks and things like that. You can just go look at different examples in the Plotly galleries and find one you like.
0:29 You're like all right, what are the settings on that thing? Let me try that. And then you want to put your data into the system.
0:35 So we used our data access to go potentially to the web service or to cache, local cache and get our measurements.
0:42 And if there's none, well, we don't want to try to load this up with nothing. That might not work so well. But we just bail out
0:49 and then we're going to create three variables x for the X-axis, h for heart rate and w for weight, and then we go through
0:57 and we just build up the X-axis the H-axis, and the W-axis from the different parts of our data records. Then, super simple, we say go to put plot.
1:05 We set the data to be two graph objects a scatterplot, and a bar chart where we set the X, the Y, and the name.
1:13 That's it. Now we have a beautiful graph that's highly interactive. People are going to love it.


Talk Python's Mastodon Michael Kennedy's Mastodon