Add dates to graph tooltips

This commit is contained in:
Rowan Manning
2013-11-27 11:31:11 +00:00
parent 16231a3609
commit bb197744fd
2 changed files with 7 additions and 3 deletions

View File

@@ -216,8 +216,12 @@ $(document).ready(function(){
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$('[data-role="tooltip"]').remove();
var y = item.datapoint[1].toFixed(0);
var contents = '<h6 class="crunch">' + y + ' ' + item.series.label + '</h6>';
var count = item.datapoint[1].toFixed(0);
var date = $.plot.formatDate(new Date(item.datapoint[0]), '%d %b (%H:%M)');
var contents = '<h6 class="crunch">' +
date + '<br/>' +
count + ' ' + item.series.label +
'</h6>';
showTooltip(item.pageX, item.pageY, contents);
}
} else {

File diff suppressed because one or more lines are too long