"값 색상" 속성 생성실제로 색상을 지정하지 않고 데이터 테이블 열에 대한 값 색상 세트 생성을 어떻게 스크립팅할 수 있습니까?
선택한 열과 연결된 "값 색상" 속성을 찾을 것으로 예상되는 응용 프로그램이 있고 해당 속성이 존재하지 않으면 충돌이 발생하기 때문에 묻습니다. 관련이 없기 때문에 실제 색상 자체를 정의하고 싶지 않습니다. ~이다 값 색상 속성.
문제의 열을 마우스 오른쪽 버튼으로 클릭하고 속성 목록에서 "값 색상"을 선택하면 대화식으로 매우 쉽게 이 작업을 수행할 수 있습니다. 그러면 기본 세트가 자동으로 정의됩니다. 본질적으로 이 작업이므로 스크립팅이 필요합니다. 솔루션은 한 줄의 코드가 될 것이라고 추측하지만 유감스럽게도 그것을 볼 수 없습니다. 누구든지 도울 수 있습니까?
Re: "값 색상" 속성 생성완벽한!얻으려고 시도하는 것보다 항상 전문가에게 문의하는 것이 좋습니다. 저것 일종의 건설 권리 
고마워요, 짐!
Re: "값 색상" 속성 생성ExprList가 제대로 구성되지 않았습니다.목록에는 계산된 값이 아니라 리터럴 값이 있어야 합니다.이를 달성하는 한 가지 방법이 있습니다.
// Start of script;
Names Default To Here( 1 );
Clear Log();
dt = Open( "$SAMPLE_DATA/Big Class.JMP" );
Summarize( NamesList = by( :Name ) );
Show( NamesList );
// Build the ExprLIst to be exactly what the Value Colors
// list needs to be
ExprList = {};
For( i = 1, i <= N Items( NamesList ), i++,
Eval(
Substitute(
Expr(
Insert Into( ExprList, Expr( __Names__ = __color__ ) )
),
Expr( __Names__ ), NamesList[i],
Expr( __color__ ), 2 + i
)
)
);
Show( ExprList );
// Then insert the resulting expression as the Value Colors property of the :Names column, and I should get what I want.
:Name << set property( "Value Colors", ExprList );
// The Value Colors property is correct;
Show( :Name << get property( "Value Colors" ) );Re: "값 색상" 속성 생성귀하의 도움에 대해 Peter와 CWillden 모두에게 많은 감사를 드립니다. 불행히도 나는 아직 거기에 있지 않습니다. 하지만 문제를 약간 구체화할 수 있었습니다.첨부된 스크립트는 현재 내가 도달한 위치를 보여줍니다. 값 색상 속성에 공급할 수 있는 표현식 목록을 생성하는 방법과 관련된 마지막 어려움을 해결할 수 있다면 필요한 것을 얻을 수 있어야 합니다.
// Start of script;
clear log();
dt = Open( "$SAMPLE_DATA/Big Class.JMP" );
// The Value Colors property of the first column is initially empty;
show(:Name << get property("Value Colors"));
/*
I now want to create a Value Colors property for this column,
but I'd prefer to do it without having to identify all the names
beforehand if possible. Try CWillden's suggestion...
*/
:Name << set property("Value Colors", {});
// If I now try to color the cells by value, it DOES actually seem to have worked;
:Name << color cell by value(1);
// But the Value Colors property STILL only contains an empty list;
show(:Name << get property("Value Colors"));
/*
Unfortunately I do actually need a populated list - and it looks like I can't do it
without extracting the names explicity. Here's one way I think I COULD do it...
*/
summarize(NamesList=by(:Name));
show(NamesList);
/*
I now need to put those names into a list of expressions that follow the syntax
shown in PMRoz's post, and use that list to define the Value Colors property I need.
This next bit is WRONG - but you can see what I'm trying to do here.
What I need inside ExprList is a list of names, each coupled with an integer from 3 onwards
(to get some colors starting at red). I suspect I should probably be using the Substitute
and/or Eval Expr functions at this point, but I can't get the correct syntax.
*/
ExprList = {};
for(i=1, i<=nItems(NamesList), i++,
insert into(ExprList, expr(NamesList[i] = (2+i)))
);
show(ExprList);
// Then insert the resulting expression as the Value Colors property of the :Names column, and I should get what I want.
:Name << set property("Value Colors", ExprList);
// End of script.Re: "값 색상" 속성 생성다음을 수행하여 BS 값 색상 속성을 열에 넣을 수 있었습니다.
:Column 1 << Set Property("Value Colors",{});응용 프로그램이 실제로 더 강력하게 작동하도록 업데이트되어야 하는 것 같습니다.이상한 요구 사항.
Re: "값 색상" 속성 생성다음과 같이 JSL을 사용할 수 있습니다.
column(dt, "Column 1") << Set Property( "Value Colors", {2 = 45, 3 = 46, 4 = 47} );
이를 파악하는 방법은
1. 단일 숫자 열이 있는 작은 더미 테이블 만들기
2. 수동으로 추가 값 색상 기인하다
3. 테이블 이름 옆에 있는 작은 빨간색 삼각형을 클릭하고 테이블 스크립트 복사
4. JSL 스크립트 창을 열고 결과 코드를 붙여넣습니다.
다음과 같이 표시됩니다.
New Table( "Untitled 14",
Add Rows( 3 ),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Property( "Value Colors", {1 = -13977687, 2 = -3780931, 3 = -4222943} ),
Set Selected,
Set Values( [1, 2, 3] )
)
);