Skip to content

Commit e9af9d9

Browse files
committed
Fix - support pol0..pol9 functions
1 parent 0fde146 commit e9af9d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/hist/TF1Painter.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ function proivdeEvalPar(obj) {
5757
.replace(/\bTMath::/g, 'this._math.')
5858
.replace(/\bROOT::Math::/g, 'this._math.');
5959

60+
if (_func.match(/^pol[0-9]$/) && (parseInt(_func[3]) === obj.fNpar - 1)) {
61+
_func = '[0]';
62+
for (let k = 1; k < obj.fNpar; ++k)
63+
_func += ` + [${k}] * `+ ((k === 1) ? 'x' : `Math.pow(x,${k})`);
64+
}
65+
6066
for (let i = 0; i < obj.fNpar; ++i)
6167
_func = _func.replaceAll(pprefix + i + ']', `(${obj.GetParValue(i)})`);
6268

0 commit comments

Comments
 (0)