如何使用JSL通过数字列的值设置文本格式列的颜色渐变?例如,Big Class.jmp 的名称列根据高度列的值自动设置名称的颜色渐变
需要在脚本中完成。
谢谢!

自动化和脚本编写Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?这是我知道的唯一方法
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
a = {1, 3, 5};
b = {2, 4, 6};
:height << color cells( {{"Red", a}, {"blue", b}} );
theScript = Char( :height << get script );
theScript = Substr( theScript, Contains( theScript, "Color Cells" ) );
theScript = ":Name<<" || Substr(
theScript,
1,
Contains( theScript, "Set Value" ) - 3
);
Eval( Parse( theScript ) );

Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?谢谢吉姆!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
m= 4 ;Column(m)<<SET property=""></SET>
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?我没有渐变颜色图案的解决方案。
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?谢谢吉姆!
如何使用 JSL 获取单元格的填充颜色?
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?可以从报告 html 中获取颜色的地方之一。 不过,您必须执行转换
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
m = 4;
Eval(EvalExpr(
Column(dt, m) << set property(
"Color Gradient",
{"Green to White to Red", Range({Expr(Col Min(Column(m))), Expr(Col Max(Column(m))), Expr(Col Mean(Column(m)))})}
) << Color Cell by Value;
));
(dt << get as report) << get html;
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?感谢专家!

Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?另外,根据渐变的创建方式,您可以使用值颜色代替梯度列属性。 然后您可以从列属性中获取颜色。
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?txt = dt << get as report;
txt << Save HTML( "c:\tt.html" );
u = "c:\tt.html";
For( k = 0, k <= 60, k++,
Try( d1 = Open( u, HTML Table( k, Column Names( 1 ), Data Starts( 2 ) ) ) );
Wait( 0 );
);
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?请教高手如何使用RE获取这些内容?
收到后如何设置名称栏中的颜色?
谢谢!
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?编辑器

Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?这个脚本中做了很多假设,而且它绝对不可靠
and drop first row (headers)
l = Words(Regex(str, ""), "\!N");
Remove From(l, 1,2);
Remove From(l, N Items(l));
// Get bgcolors
colors = {};
For Each({line}, l,
str = Regex(line, "bgcolor=#(.*?)>", "\1");
Insert Into(colors, str);
);
// Convert colors
// Option 1 (might work?)
jmp_colors = Transform Each({color}, colors, Hex To Number(color) * -1);
// Option 2
jmp_colors2 = Transform Each({color}, colors,
r = Hex To Number(Left(color, 2));
g = Hex To Number(Substr(color, 3, 2));
b = Hex To Number(Right(color, 2));
RGB Color({r,g,b});
);
// Set colors
// One row at the time
For Each Row(
:name << Color Cells(jmp_colors[Row()], Row());
);
// Or create list of lists and use that
color_list = Transform Each({jmp_color, idx}, jmp_colors2,
Eval List({jmp_color, idx});
);
Eval(EvalExpr(:age << Color Cells(Expr(color_list))));Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
m = 4;
Eval(
Eval Expr(
Column(dt, m) << set property(
"Color Gradient",
{"Green to White to Red", Range(
{Expr(Col Min(Column(m))), Expr(Col Max(Column(m))), Expr(Col Mean(Column(m)))}
)}
) << Color Cell by Value(1);
)
);
// Lots of assumptions made in this solution
str = (dt << get as report) << get html;
// get just Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?没有效果吗?
l = Words(Regex(str, ""), "\!N");
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?我用了这句话 JSL 没有理解正确,出于某种原因,JMP 17
谢谢!
str = (dt << get as report) << get html;
// get just and drop first row (headers)
l = Words(Regex(str, ""), "\!N");
Remove From(l, 1,2);
Remove From(l, N Items(l));
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?您的正则表达式模式不正确
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?
Eval(EvalExpr(:age << Color Cells(Expr(color_list))));
如何将此 JSL 修改为循环?
感谢您的帮助!
For( j = 1, j <= N Row( dt ), j++,
dt[j, "age"] << color_list( {j} )//?
);
Re: 如何使用JSL通过数字列的值设置文本格式列的颜色渐变?您可以从我使用的 Transform Each 中得到这个想法,或者使用 For Each Row 的其他方法