Skip to content

Commit ac77b58

Browse files
committed
merge: Fix - support time display in TMultiGraph
1 parent 5d77513 commit ac77b58

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Changes in 5.4.x
44
1. Fix - take into account extra quotes in multipart http reply (#157)
55
2. Fix - display of labels on X axis with TProfile
6+
3. Fix - support time display in TMultiGraph
67

78

89
## Changes in 5.4.1

scripts/JSRootPainter.more.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,9 +3073,10 @@
30733073
TMultiGraphPainter.prototype.ScanGraphsRange = function(graphs, histo, pad) {
30743074
var mgraph = this.GetObject(),
30753075
maximum, minimum, dx, dy, uxmin = 0, uxmax = 0, logx = false, logy = false,
3076+
time_display = false, time_format = "",
30763077
rw = { xmin: 0, xmax: 0, ymin: 0, ymax: 0, first: true };
30773078

3078-
if (pad!=null) {
3079+
if (pad) {
30793080
logx = pad.fLogx;
30803081
logy = pad.fLogy;
30813082
rw.xmin = pad.fUxmin;
@@ -3084,10 +3085,10 @@
30843085
rw.ymax = pad.fUymax;
30853086
rw.first = false;
30863087
}
3087-
if (histo!=null) {
3088+
if (histo) {
30883089
minimum = histo.fYaxis.fXmin;
30893090
maximum = histo.fYaxis.fXmax;
3090-
if (pad!=null) {
3091+
if (pad) {
30913092
uxmin = this.padtoX(pad, rw.xmin);
30923093
uxmax = this.padtoX(pad, rw.xmax);
30933094
}
@@ -3097,6 +3098,11 @@
30973098
for (var i = 0; i < graphs.arr.length; ++i)
30983099
this.ComputeGraphRange(rw, graphs.arr[i]);
30993100

3101+
if (graphs.arr[0] && graphs.arr[0].fHistogram && graphs.arr[0].fHistogram.fXaxis.fTimeDisplay) {
3102+
time_display = true;
3103+
time_format = graphs.arr[0].fHistogram.fXaxis.fTimeFormat;
3104+
}
3105+
31003106
if (rw.xmin == rw.xmax) rw.xmax += 1.;
31013107
if (rw.ymin == rw.ymax) rw.ymax += 1.;
31023108
dx = 0.05 * (rw.xmax - rw.xmin);
@@ -3140,7 +3146,9 @@
31403146
histo.fTitle = mgraph.fTitle;
31413147
histo.fXaxis.fXmin = uxmin;
31423148
histo.fXaxis.fXmax = uxmax;
3143-
}
3149+
histo.fXaxis.fTimeDisplay = time_display;
3150+
if (time_display) histo.fXaxis.fTimeFormat = time_format;
3151+
}
31443152

31453153
histo.fYaxis.fXmin = minimum;
31463154
histo.fYaxis.fXmax = maximum;

0 commit comments

Comments
 (0)