Current Activity - Graph

by tylerforesthauser

HTML

<script src="https://www.gstatic.com/charts/loader.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<body class="bg-dark">
  
  <div id="pacman" style="width: 300px; height: 300px;"></div>

  <div class="modal fade" id="alertModal">
      <div class="modal-dialog" role="document">
          <div class="modal-content">
              <div class="modal-header">
                  <h5 class="modal-title" id="alertTitle">Modal title</h5>
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                      <span aria-hidden="true">&times;</span>
                  </button>
              </div>
              <div class="modal-body" id="alertBody">
                  <p>Modal body text goes here.</p>
              </div>
          </div>
      </div>
  </div>
  
</body>

JavaScript

const jsonData = {
  "MediaContainer": {
    "size": 2,
    "Metadata": [
      {
        "addedAt": "1495146718",
        "art": "/library/metadata/308850/art/1523393383",
        "audienceRating": "5.2",
        "audienceRatingImage": "rottentomatoes://image.rating.spilled",
        "chapterSource": "mixed",
        "contentRating": "PG",
        "duration": "5873205",
        "guid": "com.plexapp.agents.imdb://tt3874544?lang=en",
        "key": "/library/metadata/308850",
        "lastViewedAt": "1540923555",
        "librarySectionID": "2",
        "librarySectionKey": "/library/sections/2",
        "librarySectionTitle": "Movies",
        "originallyAvailableAt": "2017-03-23",
        "primaryExtraKey": "/library/metadata/394955",
        "rating": "5.2",
        "ratingImage": "rottentomatoes://image.rating.rotten",
        "ratingKey": "308850",
        "sessionKey": "253",
        "studio": "20th Century Fox",
        "summary": "A story about how a new baby's arrival impacts a family, told from the point of view of a delightfully unreliable narrator, a wildly imaginative 7 year old named Tim.",
        "tagline": "Born leader",
        "thumb": "/library/metadata/308850/thumb/1523393383",
        "title": "The Boss Baby",
        "titleSort": "Boss Baby",
        "type": "movie",
        "updatedAt": "1523393383",
        "viewCount": "8",
        "viewOffset": "2764000",
        "year": "2017",
        "Media": [
          {
            "id": "1539461",
            "videoProfile": "main",
            "audioChannels": "2",
            "audioCodec": "aac",
            "bitrate": "1897",
            "container": "mp4",
            "duration": "5873205",
            "height": "304",
            "optimizedForStreaming": "1",
            "protocol": "dash",
            "videoCodec": "h264",
            "videoFrameRate": "24p",
            "videoResolution": "SD",
            "width": "718",
            "selected": true,
            "Part": [
              {
 ...