From 9392bec63bd1057f263dacdd985b628f40fd04bf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 3 Mar 2015 17:08:01 +0100 Subject: show total/matched number of samples in barplot hover --- public/js/d3funcs.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'public') 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 "Frequency: " + d.y + ""; - }) + if (d.y_matched == undefined) { + return "n=" + d.y_total + ""; + } + else { + return "" + d.y_matched + " von " + + "" + d.y_total + ""; + } + }); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) -- cgit v1.2.3