Skip to content

Commit 3f04da4

Browse files
committed
Fix - refill stat also for empty histogram if this is main histogram
1 parent 3dd517b commit 3f04da4

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Changes in 5.0.x
44
1. Fix - read many branch entries as arrays
5-
2. Fix - command sumbission to THttpServer
5+
2. Fix - command sumbission to THttpServer
6+
3. Fix - refill stat also for empty histogram if this is main histogram
67

78

89
## Changes in 5.0.1

scripts/JSRootPainter.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,10 +3823,9 @@
38233823
// no need to refill statistic if histogram is dummy
38243824
if (main.IsDummyHisto()) return true;
38253825

3826-
var dostat = new Number(pave.fOptStat);
3827-
var dofit = new Number(pave.fOptFit);
3828-
if (!dostat) dostat = JSROOT.gStyle.fOptStat;
3829-
if (!dofit) dofit = JSROOT.gStyle.fOptFit;
3826+
var dostat = parseInt(pave.fOptStat), dofit = parseInt(pave.fOptFit);
3827+
if (isNaN(dostat)) dostat = JSROOT.gStyle.fOptStat;
3828+
if (isNaN(dofit)) dofit = JSROOT.gStyle.fOptFit;
38303829

38313830
// make empty at the beginning
38323831
pave.Clear();
@@ -5321,7 +5320,7 @@
53215320
JSROOT.THistPainter.prototype = Object.create(JSROOT.TObjectPainter.prototype);
53225321

53235322
JSROOT.THistPainter.prototype.IsDummyHisto = function() {
5324-
return (this.histo==null) || !this.draw_content || (this.options.Axis>0);
5323+
return !this.histo || (!this.draw_content && !this.create_stats) || (this.options.Axis>0);
53255324
}
53265325

53275326
JSROOT.THistPainter.prototype.IsTProfile = function() {
@@ -6313,8 +6312,10 @@
63136312

63146313
if (!this.draw_content || !this.is_main_painter()) return null;
63156314

6315+
this.create_stats = true;
6316+
63166317
var stats = this.FindStat();
6317-
if (stats != null) return stats;
6318+
if (stats) return stats;
63186319

63196320
var st = JSROOT.gStyle;
63206321

0 commit comments

Comments
 (0)