JSL - 동적 차트 범례 변경안녕하세요 친구,
아래 코드를 사용하여 라디오 상자 사용자 선택에 따라 bivirate 차트의 범례 및 스플라인을 변경하고 있습니다.
스플라인 부분은 잘 작동하지만 범례는 변경되지 않습니다 
어떤 아이디어?

//Begin Script;
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
variables = {"age", "sex"};
// Initial nlevels is the number of levels of 'age', as it is the first by-group used.
nlevels=6;
// Creating the legend. For each selection, the previous spline fits are removed, then
// new ones are generated.
BC_legend = Panel Box( "Choose Legend",
legend = Radio Box(
{"age", "sex"},
fitVar = legend << Get Selected;
Match( fitVar,
"age",
(Summarize(vals = By( :age ), c=count );
For(ii = 1, ii <=nlevels, ii++,
obj << (Curve[1] << Remove Fit );
);
obj << Group By( :age ) << Fit Spline( 0.1, standardized );
nlevels = nItems(vals);
),
"sex",
(Summarize(vals = By( :sex ), c=count );
For(ii = 1, ii <=nlevels, ii++,
obj << (Curve[1] << Remove Fit );
);
obj << Group By( :sex ) << Fit Spline( 0.1, standardized );
nlevels = nItems(vals); )
);
));
// Fitting the initial Bivariate fit with 'age' as the by-group, adding the legend
// to control the selections.
nw = New Window( "BigClassBivariate",
HListBox(
obj = dt << Bivariate(
Y( :weight ),
X( :height ),
Group By( :age ),
Fit Spline( 0.1, standardized ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 493, 354 ),Marker Size( 2 ), Marker Drawing Mode( "Normal" ), Row Legend(
dt:(fitVar),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "Standard" ),
Continuous Scale( Cont ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
); ,
BC_legend
));
//End Script;
Re: JSL - 동적 차트 범례 변경가변성 차트에서 이것을 실행하는 방법을 찾은 것 같습니다.
동적 범례가 있는 다중(사용:***) 가변성 차트를 원하는 경우 무엇을 추가해야 합니까?
//Begin Script;
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
variables = {"age", "sex"};
// Initial nlevels is the number of levels of 'age', as it is the first by-group used.
fitVar = "age";
nlevels = 6;
// Creating the legend. For each selection, the previous spline fits are removed, then
// new ones are generated.
BC_legend = Panel Box( "Choose Legend",
legend = Radio Box(
{"age", "sex"},
fitVar = legend << Get Selected;
Match( fitVar,
"age",
(Summarize( vals = By( :age ), c = count ) ; Report( obj )[Border Box( 2 )] << Delete ;
Report( obj )[FrameBox( 1 )] << Row Legend( "age", color( 1 ), Marker( 1 ) ) ;
// obj << Group By( :sex );
nlevels = N Items( vals ) ; ;
),
"sex",
(Summarize( vals = By( :sex ), c = count ) ; Report( obj )[Border Box( 2 )] << Delete ;
Report( obj )[FrameBox( 1 )] << Row Legend( "sex", color( 1 ), Marker( 1 ) ) ;
// obj << Group By( :sex );
nlevels = N Items( vals ) ; )
);
)
);
// Fitting the initial Bivariate fit with 'age' as the by-group, adding the legend
// to control the selections.
nw = New Window( "BigClassBivariate",
H List Box(
obj = dt <<
Variability Chart(
Y( :weight ),
X( :height ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
SendToReport(
Dispatch(
{},
"Variability Chart",
FrameBox,
{Marker Size( 8 ), Marker Drawing Mode( "Normal" ) ;
Row Legend(
dt:(fitVar),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "Classic" ),
Continuous Scale( Cont ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
BC_legend
)
);
//End Script;
Re: JSL - 동적 차트 범례 변경안녕 그레이트 스크립트
간단한 가변성 차트에서 이 스크립트를 어떻게 사용합니까?
베스트 R
일란
Re: JSL - 동적 차트 범례 변경@RB ,
스크립트에서 범례를 제거하고 추가해야 합니다. 또한 마지막에서 처음으로 항목을 제거하는 것이 더 안전하다고 생각합니다.
첨부된 스크립트는 2개입니다.
- 스크립트를 약간 변경하는 DynamicChartLegend_Working.jsl입니다.
- DynamicChartLegend_Generic.jsl은 각 변수에 대해 "쿠키 커터" 코드를 사용할 필요가 없도록 더 많은 변경을 수행합니다. 이는 참조 변수를 사용하고 GetLevels() 함수를 만들고 사용하여 수행됩니다.
현재 사용 중인 JMP 버전을 언급하지 않았습니다. 이러한 스크립트가 작동하지 않으면 JMP 버전에 대한 정보를 제공하십시오.