I would have edited my earlier post, but this new community layout has made user experience worse than it was before... so I will create new message (I would have liked to add spoiler tags to the JSL)

/*""" Create databar column function
Author: jthi
Creation Date: 2025-10-18
Creation JMP Version: JMP Pro 18.2.1
"""*/
Names Default To Here(1);
add_databar_column = function({dt, colname, leave_formula = 1}, {Default Local},
newcol = Eval(Substitute(
Expr(dt << New Column(colname || " Data Bar", Expression, None, Formula(
As Constant(
left_color = -15775706; // pinkish
right_color = -11393916; // light green
minval = Col Min(_colref_);//, Excluded());
maxval = Col Max(_colref_);//, Excluded());
If(minval >= 0,
minval = 0;
);
If(maxval <= 0,
maxval = 0
);
scaling = (maxval - minval) / 100;
);
If(_colref_ >= 0,
right = _colref_;
right_filler = maxval - _colref_;
left_filler = Abs(minval);
left = 0;
,
left = Abs(_colref_);
left_filler = Abs(minval) - left;
right_filler = maxval;
right = 0;
);
bb = Border Box(Top(2), Bottom(2), Sides(15),
H List Box(align("Center"),
Spacer Box(Size(left_filler / scaling, 13), Color("White")),
Spacer Box(size(left / scaling, 13), color(left_color)),
Spacer Box(size(right / scaling, 13), color(right_color)),
Spacer Box(Size(right_filler / scaling, 13), Color("White")),
),
<< Backgroundcolor("White")
);
))),
Expr(_colref_), Name Expr(AsColumn(dt, colname));
));
If(!leave_formula,
dt << Run Formulas;
newcol << Delete Formula;
);
newcol << Set Display Width(110);
return(newcol);
);
/*
// Example
dt = open("$SAMPLE_DATA/BabySleep.jmp");
add_databar_column(dt, "Awake");
add_databar_column(dt, "Asleep");
add_databar_column(dt, "Dif");
*/
-Jarmo