<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Data bars in table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908450#M106697</link>
    <description>&lt;P&gt;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)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1760803998675.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85311iBF294895B9EB18C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1760803998675.png" alt="jthi_0-1760803998675.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*""" 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 &amp;lt;&amp;lt; 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 &amp;gt;= 0,
					minval = 0;
				);
				If(maxval &amp;lt;= 0,
					maxval = 0
				);
				
				scaling = (maxval - minval) / 100;
				
			);
			
			If(_colref_ &amp;gt;= 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")),
				),
				&amp;lt;&amp;lt; Backgroundcolor("White")
			);			
		))),
		Expr(_colref_), Name Expr(AsColumn(dt, colname));
	));
	
	If(!leave_formula,
		dt &amp;lt;&amp;lt; Run Formulas;
		newcol &amp;lt;&amp;lt; Delete Formula;
	);
	
	newcol &amp;lt;&amp;lt; 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");
*/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Oct 2025 16:14:00 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-10-18T16:14:00Z</dc:date>
    <item>
      <title>Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908227#M106648</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;is it possible to add data bars in JMP data table, in a similar fashion as in Excel? The closest I can come to is Color Gradient properties in Columns, but data bars would be preferred.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aatw_0-1760694988792.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85242i4B12936D2F91F8C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aatw_0-1760694988792.jpeg" alt="aatw_0-1760694988792.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 09:57:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908227#M106648</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2025-10-17T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908241#M106649</link>
      <description>&lt;P&gt;Easiest would be to use Tabulate&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1760695890855.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85245i004A83B40872AC5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1760695890855.png" alt="jthi_0-1760695890855.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or Table Box() with Col Plot Box()&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1760696057284.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85246i88C6F820521660BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1760696057284.png" alt="jthi_1-1760696057284.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 10:14:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908241#M106649</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-17T10:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908350#M106669</link>
      <description>&lt;P&gt;You could also try to play around with different display boxes and then use &amp;lt;&amp;lt; get picture. For example for Big Class JMP Table using following as your formula (Expression data type)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Eval Expr(
		Graph Box(
			Frame Size(Col Max(:weight) * 10, 300),
			Y Scale(0, 100),
			X Scale(0, Expr(Col Max(:weight))),
			Fill Color("Red");
			Rect(0, 100, Expr(:weight), 0, 1);
			Text Color("Black");
			Text Size(200);
			Text(Center Justified, {Expr(:weight / 2), 20}, Expr(Char(:weight)));
		)
	)
) &amp;lt;&amp;lt; get picture&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will end up with something like&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1760720627718.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85261iCFF5E01347922132/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1760720627718.png" alt="jthi_1-1760720627718.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Oct 2025 17:04:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908350#M106669</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-17T17:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908398#M106685</link>
      <description>&lt;P&gt;wow!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 05:57:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908398#M106685</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-18T05:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908410#M106686</link>
      <description>&lt;P&gt;hard to find:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;suppressaxes&lt;BR /&gt;&lt;/FONT&gt;what is doubleBuffer?&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1760775683171.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85287i11492A7A177B53F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1760775683171.png" alt="hogi_0-1760775683171.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 08:21:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908410#M106686</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-18T08:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908442#M106692</link>
      <description>&lt;P&gt;Also, if you do not need the text inside bars, you could use Spacer Boxes instead of Graph Box. Below is quick and very hacky example (I will write better version when I have slightly more time to think about this)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; New Column("R", Expression, None, Formula(
	As Constant(
		left_color = "Red";
		right_color = "Green";
		minval = Col Min(:Weight);
		maxval = Col Max(:Weight);
		
		scaling = (maxval - minval) / 300;
		
		If(minval &amp;gt;= 0,
			minval = 0;
		);
		If(maxval &amp;lt;= 0,
			maxval = 0
		);
	);
	
	If(:Weight &amp;gt;= 0,
		right = :Weight;
		right_filler = maxval - :Weight;
		left_filler = Abs(minval);
		left = 0;
	,
		left = Abs(:Weight);
		left_filler = Abs(minval) - left;
		right_filler = maxval;
		right = 0;
	);
	
	H List Box(align("Center"),
		Spacer Box(Size(1, 20), Color("Black")),
		Spacer Box(Size(left_filler * scaling, 20), Color("White")),
		Spacer Box(size(left * scaling, 20), color(left_color)),
		Spacer Box(Size(1, 20), Color("Black")),
		Spacer Box(size(right * scaling, 20), color(right_color)),
		Spacer Box(Size(right_filler * scaling, 20), Color("White")),
		Spacer Box(Size(1, 20), Color("Black"))
	);
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1760799831992.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85309i3B2058579346ACC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_1-1760799831992.png" alt="jthi_1-1760799831992.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With negative values:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1760799737303.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85308i0E04EB37A0C912B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1760799737303.png" alt="jthi_0-1760799737303.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also, if you would like to have feature like this in JMP, create post to &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/idb-p/jmp-wish-list" target="_blank" rel="noopener"&gt;JMP Wish List&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 15:04:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908442#M106692</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-18T15:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908443#M106693</link>
      <description>&lt;P&gt;wow, many orders of magnitude faster!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Oct 2025 15:10:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908443#M106693</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-18T15:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data bars in table</title>
      <link>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908450#M106697</link>
      <description>&lt;P&gt;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)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1760803998675.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/85311iBF294895B9EB18C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1760803998675.png" alt="jthi_0-1760803998675.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*""" 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 &amp;lt;&amp;lt; 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 &amp;gt;= 0,
					minval = 0;
				);
				If(maxval &amp;lt;= 0,
					maxval = 0
				);
				
				scaling = (maxval - minval) / 100;
				
			);
			
			If(_colref_ &amp;gt;= 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")),
				),
				&amp;lt;&amp;lt; Backgroundcolor("White")
			);			
		))),
		Expr(_colref_), Name Expr(AsColumn(dt, colname));
	));
	
	If(!leave_formula,
		dt &amp;lt;&amp;lt; Run Formulas;
		newcol &amp;lt;&amp;lt; Delete Formula;
	);
	
	newcol &amp;lt;&amp;lt; 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");
*/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Oct 2025 16:14:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-bars-in-table/m-p/908450#M106697</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-18T16:14:00Z</dc:date>
    </item>
  </channel>
</rss>

