모두들 안녕,
사전 정의 된 채우기 패턴으로 지정된 변수에 대한 일부 막대를 자동으로 채우고 싶습니다. 그러나 변수의 수가 바뀌고 있으며 현재 데이터 테이블에 저장된 변수에 따라 반복적으로 수행하고 싶습니다. 이 경우 인덱스 (작동하지 않는 것으로 보임) 또는 목록에서 참조로 Fill Pattern ()에 인수를 제공해야하지만 채우기 패턴 목록이 필요합니다. 그런 다음 목록에서 항목 색인을 사용할 수 있습니다. 그렇게하는 데 도움을 주셔서 감사합니다.
친애하는
Graph Builder(
Size( 734, 660 ),
Variables( //that would be good to have it in iteration
X( :Run ),
Y( :Param0 ),
Y( :Param1, Position( 2 ) ),
Y( :Param2, Position( 2 ) ),
Y( :Param3, Position( 2 ) ),
// there is much more of such variables to be displayed
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 455 ) ) ),
Elements( //that would be good to have it in iteration
Position( 1, 2 ),
Bar(
X,
Y( 3 ),
Y( 5 ),
Y( 6 ),
Y( 7 ),
Legend( 454 ),
Bar Style( "Stacked" )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
455,
Properties( 0, {Line Color( 25 )}, Item ID( "Param0", 1 ) )
), Legend Model(
454,
//that would be good to have it in iteration
Properties(
0,
{Fill Pattern( "left slant light" )},
Item ID( "Mittelwert(Param1)", 1 )
),
Properties(
2,
{Fill Pattern( "right slant light" )},
Item ID( "Mittelwert(Param2)", 1 )
),
Properties(
3,
{Fill Pattern( "grid heavy" )},
Item ID( "Mittelwert(Param3)", 1 )
),
// there is much more of such properties
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{455, [0], 454, [10, -1, 1, 11]}
), Position(
{0, 10, -1, 1, 11}
)}
)
)
);
편집하다:
데이터를 전달할 수있는 표현식을 사용하여 위의 문제를 해결하기 시작했습니다.
"for-loop"에서 막대 차트 범례의 속성을 설정하고 for-loop 전에 정의 된 legend_model_expr에 삽입하려고했습니다. 그런 다음 그래프 빌더의 적절한 위치에서 해당 표현식을 대체합니다. 이 경우 두 가지 문제가 발생했습니다. 먼저, "삽입"추천이 모두 주석 처리되면 오류가 발생합니다.
이름이 확인되지 않음 : 속성에 액세스하거나 평가할 때 속성. 내가 올바르게 사용하고 있습니까? 두 번째로 "insert into"(또는 둘 중 하나)의 주석을 해제하면 다른 오류가 표시됩니다. For에 액세스하거나 평가할 때 인수가 너무 많습니다.
내가 뭘 놓치고 있는지 힌트를 주셔서 감사합니다. 친애하는.
//pattern list
fill_patterns_shuffled = {"left slant light", "horizontal light", "right slant light", "vertical light"};
//list of parameters, it can change depending on data available
list2 = {"Param1", "Param2", "Param3"};
legend_model_expr = Expr( Legend Model (53) );
For( c = 1, c <= N Items( list2 ), c++,
y_expr3 = Eval(Parse( "Properties( " || char(c-1) || ", {Fill Pattern( \!"" || fill_patterns_shuffled[ c ] || "\!") }, Item ID( \!"Mittelwert(" || char(list2[ c ]) || ")\!", 1 ) ),"
),
),
//write(y_expr3);
//Insert Into( y_expr3, 1 );
//Insert Into( legend_model_expr, Name Expr( y_expr3) );
);편집하다:
자, Eval을 사용하여 JMP는 실제로 존재하지 않는 "속성"기능을 찾게되므로 아마도 오류가 발생하는 것입니다. 그러나 두 번째 오류는 남아 있습니다.
좋아, 나는 그것을 작동시켰다. 아래에 올바른 코드를 붙여 넣었습니다. 친애하는
//legend
legend_model_expr = Expr( Legend Model (26) );
For( c = 1, c <= N Items( list2 ), c++,
y_expr3 = substitute(expr( Properties( c1, {Fill Pattern( fill ) }, Item ID( "Mittelwert(" || name || ")" , 1 ), ), ), expr(c1), c, expr(fill), char(fill_patterns_shuffled[c]), expr(name), list2[c]);
//show(y_expr3);
Insert Into( y_expr3, "");
Insert Into( legend_model_expr, Name Expr( y_expr3) );
);