Learn how to write code to calculate the start and end values of the x-axis to support scrolling of the data.
- [Instructor] Okay, so now that we have properties…for capturing the lowest and highest values…to be shown on the x-axis, we now want to go…and change that minimum and maximum,…so the displayed range of values of the x-axis,…every time we receive a new value.…Why, because we want the values to scroll across the screen.…And so I'll say here on line 65,…AdjustAxis.…Based on what? The ticks.…So Ft is our data,…and it has a timestamp,…which has ticks.…
And so, I'm going to have to write a method…that changes the range of the x-axis,…the start and end of the x-axis,…based on the latest value of the latest line in the file.…So going down to AdjustAxis.…A little bit of math for us.…So remember the width of our axis was about 30 seconds.…So think of this as the range of values…that you want to display.…Timespan from seconds.…I want to display about 30 seconds worth of data.…
And so, just trust me on this one.…I had to do a bit of experimentation here…to actually figure this out.…But essentially, the axis minimum value…needs to be something,…
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.