Skip to content

Commit aff768e

Browse files
committed
Provide tooltip handling for negative bin content
Let create closed area without fill attributes, that SVG can provide events for such figure
1 parent 9898347 commit aff768e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/JSRootPainter.hist.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3883,8 +3883,12 @@
38833883
}
38843884
}
38853885

3886-
var h0 = height + 3, gry0 = Math.round(pmain.gry(0));
3887-
if (gry0 <= 0) h0 = -3; else if (gry0 < height) h0 = gry0;
3886+
var fill_for_interactive = !JSROOT.BatchMode && this.fillatt.empty() && draw_hist && (JSROOT.gStyle.Tooltip > 0) && !draw_markers && !show_line,
3887+
h0 = height + 3;
3888+
if (!fill_for_interactive) {
3889+
var gry0 = Math.round(pmain.gry(0));
3890+
if (gry0 <= 0) h0 = -3; else if (gry0 < height) h0 = gry0;
3891+
}
38883892
var close_path = "L"+currx+","+h0 + "L"+startx+","+h0 + "Z";
38893893

38903894
if (draw_markers || show_line) {
@@ -3918,7 +3922,7 @@
39183922
}
39193923

39203924
if ((res.length > 0) && draw_hist) {
3921-
if (!this.fillatt.empty())
3925+
if (!this.fillatt.empty() || fill_for_interactive)
39223926
res += close_path;
39233927
this.draw_g.append("svg:path")
39243928
.attr("d", res)

0 commit comments

Comments
 (0)