|
3073 | 3073 | TMultiGraphPainter.prototype.ScanGraphsRange = function(graphs, histo, pad) { |
3074 | 3074 | var mgraph = this.GetObject(), |
3075 | 3075 | maximum, minimum, dx, dy, uxmin = 0, uxmax = 0, logx = false, logy = false, |
| 3076 | + time_display = false, time_format = "", |
3076 | 3077 | rw = { xmin: 0, xmax: 0, ymin: 0, ymax: 0, first: true }; |
3077 | 3078 |
|
3078 | | - if (pad!=null) { |
| 3079 | + if (pad) { |
3079 | 3080 | logx = pad.fLogx; |
3080 | 3081 | logy = pad.fLogy; |
3081 | 3082 | rw.xmin = pad.fUxmin; |
|
3084 | 3085 | rw.ymax = pad.fUymax; |
3085 | 3086 | rw.first = false; |
3086 | 3087 | } |
3087 | | - if (histo!=null) { |
| 3088 | + if (histo) { |
3088 | 3089 | minimum = histo.fYaxis.fXmin; |
3089 | 3090 | maximum = histo.fYaxis.fXmax; |
3090 | | - if (pad!=null) { |
| 3091 | + if (pad) { |
3091 | 3092 | uxmin = this.padtoX(pad, rw.xmin); |
3092 | 3093 | uxmax = this.padtoX(pad, rw.xmax); |
3093 | 3094 | } |
|
3097 | 3098 | for (var i = 0; i < graphs.arr.length; ++i) |
3098 | 3099 | this.ComputeGraphRange(rw, graphs.arr[i]); |
3099 | 3100 |
|
| 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 | + |
3100 | 3106 | if (rw.xmin == rw.xmax) rw.xmax += 1.; |
3101 | 3107 | if (rw.ymin == rw.ymax) rw.ymax += 1.; |
3102 | 3108 | dx = 0.05 * (rw.xmax - rw.xmin); |
|
3140 | 3146 | histo.fTitle = mgraph.fTitle; |
3141 | 3147 | histo.fXaxis.fXmin = uxmin; |
3142 | 3148 | histo.fXaxis.fXmax = uxmax; |
3143 | | - } |
| 3149 | + histo.fXaxis.fTimeDisplay = time_display; |
| 3150 | + if (time_display) histo.fXaxis.fTimeFormat = time_format; |
| 3151 | + } |
3144 | 3152 |
|
3145 | 3153 | histo.fYaxis.fXmin = minimum; |
3146 | 3154 | histo.fYaxis.fXmax = maximum; |
|
0 commit comments