Skip to content

Commit

Permalink
Legend extended to show date not only H:M:S
Browse files Browse the repository at this point in the history
  • Loading branch information
fostex68 committed Jan 5, 2015
1 parent cc8bdad commit 694e002
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion htdocs/frontend/javascripts/wui.js
Expand Up @@ -522,7 +522,9 @@ vz.wui.updateLegend = function() {
} else {
// use plot wrapper instead of `new Date()` for timezone support
var d = $.plot.dateGenerator(pos.x, vz.options.plot.xaxis);
vz.wui.legend.eq(i).text(series.title + ": " + $.plot.formatDate(d, '%H:%M:%S') + " - " + y.toFixed(1) + " " + series.unit);
var delta = vz.options.plot.xaxis.max - vz.options.plot.xaxis.min;
var format = (delta > 1*24*3600*1000) ? '%d.%m.%y - %H:%M' : '%H:%M:%S';
vz.wui.legend.eq(i).text(series.title + ": " + $.plot.formatDate(d,format) + " - " + y.toFixed(0) + " " + series.unit);
}
}

Expand Down

0 comments on commit 694e002

Please sign in to comment.