如何使用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 的其他方法