diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-03-03 17:08:01 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-03-03 17:08:01 +0100 |
commit | 9392bec63bd1057f263dacdd985b628f40fd04bf (patch) | |
tree | d575d4e67cf053af5f35ed7400a0b92fa4324ebb /public | |
parent | 5268977803fde3e15ad59bdd1673cb7d85d0a01f (diff) |
show total/matched number of samples in barplot hover
Diffstat (limited to 'public')
-rw-r--r-- | public/js/d3funcs.js | 10 |
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) |