summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-03-03 17:08:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2015-03-03 17:08:01 +0100
commit9392bec63bd1057f263dacdd985b628f40fd04bf (patch)
treed575d4e67cf053af5f35ed7400a0b92fa4324ebb /public
parent5268977803fde3e15ad59bdd1673cb7d85d0a01f (diff)
show total/matched number of samples in barplot hover
Diffstat (limited to 'public')
-rw-r--r--public/js/d3funcs.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/public/js/d3funcs.js b/public/js/d3funcs.js
index 0b68bcb..fb50345 100644
--- a/public/js/d3funcs.js
+++ b/public/js/d3funcs.js
@@ -33,8 +33,14 @@ show_bargraph = function(datasource, title, xLabel, yLabel, yFormat, width, heig
.attr('class', 'd3-tip')
.offset([-10, 0])
.html(function(d) {
- return "<strong>Frequency:</strong> <span style='color:red'>" + d.y + "</span>";
- })
+ if (d.y_matched == undefined) {
+ return "n=<span style='color:orangered'>" + d.y_total + "</span>";
+ }
+ else {
+ return "<span style='color:orangered'>" + d.y_matched + "</span> von " +
+ "<span style='color:orangered'>" + d.y_total + "</span>";
+ }
+ });
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)