Learn how to write the code to load the data from a file into the Chart Values collection.
- [Instructor] So let's load some data.…There is a sample data file provided.…Put its name into this variable here, line 48,…and then we'll just read as if we have it.…So I made this easier for you.…There is a load method on the FactoryTelemetry class.…We just pass in the file name.…And it would load you multiple lines of text,…process each line of text by parsing it,…and give you back a FactoryTelemetry object.…
So ft has the properties for all the values…we're looking for,…red, blue, green, engine efficiency, pulse,…and even a timestamp.…So ChartValues is the collection we're trying to use…to graph from…and so we'll add ft to it.…Now, hold on a second.…How does this work?…Well, it doesn't work yet.…ChartValues, as a collection,…is a collection of type FactoryTelemetry.…And so we've added one of those into the collection,…but the system doesn't yet know how to convert that…into an X and a Y coordinate.…
So we would need to explain ourselves.…Also, by adding values one after another,…we will essentially be going too fast.…
Skill Level Intermediate
1. Problem 1: Pond Oreille
2. Problem 2: Where Am I?
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Facial Recognition
6. Problem 6: Real-Time Information Dashboard
Next steps2m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.