# tooltip_format.js

var data = [
  {name: "Adam", value: [{"start": "December 17, 2012 21:00:00", "end": "December 17, 2012 23:00:00"}, {"start": "December 17, 2012 23:30:00", "end": "December 18, 2012 11:00:00"}]},
  {name: "Eva", value: [{"start": "December 17, 2012 23:00:00", "end": "December 17, 2012 23:30:00"}, ]},
  {name: "Jes", value: [{"start": "December 17, 2012 23:30:00", "end": "December 18, 2012 00:05:00"}]}
];

var options = {
  id: "chart", 
  margin: {
    left: 100, 
  }, 
  data: {
    plain: data 
  },
  tooltip: {
    format: function(data, index) {
      return data.name + 'Start at hour: ' + data.start.getHours() + 'End at hour: ' + data.end.getHours();
    }
  },
  axis: {
    x: {
      label: {
        text : 'Time'
      }
    }
  },
  striped: true,
};
var timelineChart = new C9.TimeLine(options);
timelineChart.draw();