<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {{'packages':['annotatedtimeline']}});
      google.setOnLoadCallback(drawChart);
      function epoch2dt(dataTable, rowNum){{
        return new Date(dataTable.getValue(rowNum, 0));
      }}
      function delta(dataTable, rowNum){{
          try {{
              previous = dataTable.getValue(rowNum, 0);
              nowdt = dataTable.getValue(rowNum-1, 0);
              delta = nowdt - previous;
            return delta / 1000
          }}
          catch (err){{
              return 0
          }}
      }}
      function drawChart() {{
        var data = new google.visualization.DataTable();
        data.addColumn('number', 'date time');
        data.addColumn('number', '{set_1_name}');
        data.addColumn("number", '{set_2_name}');
        data.addRows({json_data});
        var myView = new google.visualization.DataView(data);
        myView.setColumns([
            {{calc:epoch2dt, label:"Date Time", type:"datetime"}},
            1,
            2
            ]
            );
        var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
        var options = {{'displayAnnotations': true, 'scaleType': 'allmaximized', 'scaleColumns': [0,1]}}
        chart.draw(myView, options);
      }}
    </script>
  </head>
  <body>
      <h2>{title}</h2>
      <h3>{subtitle}</h3>
    <div id='chart_div' style='width: 1200px; height: 700px;'></div>
    <div>Wait, untill the chart loads, it takes some seconds till you see it...(this messsage will stay here even when chart loaded)</div>
  </body>
</html>
