|
3900 | 3900 | histo = this.GetHisto(), |
3901 | 3901 | x1 = histo.fXaxis.GetBinLowEdge(bin+1), |
3902 | 3902 | x2 = histo.fXaxis.GetBinLowEdge(bin+2), |
3903 | | - cont = histo.getBinContent(bin+1); |
| 3903 | + cont = histo.getBinContent(bin+1), |
| 3904 | + xlbl = "", xnormal = false; |
3904 | 3905 |
|
3905 | 3906 | if (name.length>0) tips.push(name); |
3906 | 3907 |
|
| 3908 | + if (pmain.x_kind === 'labels') xlbl = pmain.AxisAsText("x", x1); else |
| 3909 | + if (pmain.x_kind === 'time') xlbl = pmain.AxisAsText("x", (x1+x2)/2); else |
| 3910 | + { xnormal = true; xlbl = "[" + pmain.AxisAsText("x", x1) + ", " + pmain.AxisAsText("x", x2) + ")"; } |
| 3911 | + |
3907 | 3912 | if (this.options.Error || this.options.Mark) { |
3908 | | - tips.push("x = " + pmain.AxisAsText("x", (x1+x2)/2)); |
| 3913 | + tips.push("x = " + xlbl); |
3909 | 3914 | tips.push("y = " + pmain.AxisAsText("y", cont)); |
3910 | 3915 | if (this.options.Error) { |
3911 | | - tips.push("error x = " + ((x2 - x1) / 2).toPrecision(4)); |
| 3916 | + if (xnormal) tips.push("error x = " + ((x2 - x1) / 2).toPrecision(4)); |
3912 | 3917 | tips.push("error y = " + histo.getBinError(bin + 1).toPrecision(4)); |
3913 | 3918 | } |
3914 | 3919 | } else { |
3915 | 3920 | tips.push("bin = " + (bin+1)); |
3916 | | - |
3917 | | - if (pmain.x_kind === 'labels') |
3918 | | - tips.push("x = " + pmain.AxisAsText("x", x1)); |
3919 | | - else |
3920 | | - if (pmain.x_kind === 'time') |
3921 | | - tips.push("x = " + pmain.AxisAsText("x", (x1+x2)/2)); |
3922 | | - else |
3923 | | - tips.push("x = [" + pmain.AxisAsText("x", x1) + ", " + pmain.AxisAsText("x", x2) + ")"); |
3924 | | - |
| 3921 | + tips.push("x = " + xlbl); |
3925 | 3922 | if (histo['$baseh']) cont -= histo['$baseh'].getBinContent(bin+1); |
3926 | | - |
3927 | 3923 | if (cont === Math.round(cont)) |
3928 | 3924 | tips.push("entries = " + cont); |
3929 | 3925 | else |
|
0 commit comments