안녕,
저는 다양한 열이 있는 파일로 작업할 스크립트를 작성하고 있으므로 열 수를 기반으로 Graph Builder 호출을 연결하는 여기에서 찾은 예제를 수정해야 했습니다.어색함에도 불구하고 작동하는 것 같지만 내 문제는 X 축을 로그 스케일로 변경하고 제한을 변경하는 등의 작업을 원한다는 것입니다.Scripting Index 및 예제에서 몇 가지 접근 방식을 시도했지만 아무 것도 작동하지 않는 것 같습니다.
축 설정에서 올바른 방향으로 포인터를 보내주시면 대단히 감사하겠습니다. 그러나 초기 그래프 부분을 더 잘 수행하는 방법에 대한 아이디어가 있는 사람이 있다면 그것도 좋을 것입니다. 감사합니다!
dt = Current Data Table();
ColNameList = dt << Get Column Names (continuous, string);
//Start with initial graph builder
GraphExpr = "
TestGraph = Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables(";
//Add X Entry
GraphExpr = GraphExpr || "
X( :Name( \!"" || ColNameList[1] || "\!") ),";
//Add the first Y entry
GraphExpr = GraphExpr || "
Y( :Name( \!"" || ColNameList[2] || "\!") ),";
//Add the second Y entry
For( i = 3, i <= N items (ColNameList), i++,
GraphExpr = GraphExpr || "
Y( :Name( \!"" || ColNameList[i] || "\!"), Position (1) ),";
);
//Close out Variables section
GraphExpr = GraphExpr || "
),
Elements(
Line( X, Y( 1 )";
//Build out the lines for all columns
For( i = 2, i <= N items (ColNameList), i++,
GraphExpr = GraphExpr || ", Y( " || char(i) || " )"
);
GraphExpr = GraphExpr || ", Legend( 1 )
)
)
)";
eval(parse(GraphExpr));
TestGraph << Show Legend (0);
Gradient Legend 설정에 대해 이 작업을 수행하는 방법에 대한 설명이 있습니까?
나는 시도했다
Report( gb)[Legend Box(1)] << Legend Model( ...
하지만 작동하지 않았다
짐님, 빠른 답변 감사합니다.잘 작동합니다.해당 그래프 항목을 참조하기 위해 report()를 사용해야 하는지 몰랐습니다. TestGraph[AxisBox(2)] << scale(log)를 사용하려고 했을 뿐입니다.
감사해요,
토드
축을 변경하는 모든 메시지는 AxisBox의 스크립팅 인덱스 항목에서 사용할 수 있습니다.
사용하고 싶은 것은,
report(TestGraph)[AxisBox(2)] << scale(log);
안녕,
이것은 Graph Builder 식을 작성하는 다소 복잡한 방법입니다. "자리 표시자"(gbe = Expr (Graph Builder(...)))를 사용하여 전체 GB 표현식을 정의하는 방법을 살펴보고 싶을 수 있습니다. 대체 기능을 사용하여 자리 표시자를 열, 변수, 레이블 등으로 바꿉니다. , 그런 다음 Eval() 함수를 사용하여 그래프를 생성합니다(미안하지만 지금은 자세한 내용을 제공할 시간이 없습니다).
특정 질문에 대해 Graph Builder 식을 변수에 할당하면(예: gb = Graph Builder (...);) 아래 방법을 사용하여 필요한 방식으로 축을 업데이트할 수 있습니다.
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :age, Size( 23 ) ),
Y( :height, Size( 37 ) ),
Y( :weight, Position( 1 ), Size( 37 ), Side( "Right" ) )
),
Elements( Points( X, Y( 1 ), Legend( 1 ), Jitter( 1 ) ), Points( X, Y( 2 ), Legend( 3 ), Jitter( 1 ) ) )
);
framebox = Report( gb )[framebox( 1 )];
framebox << Y Axis(
Scale ("Log"),
Add Ref Line( 61.25, "Solid", "Medium Dark Green" ),
Show Major Grid( 1 ),
Show Minor Grid( 1 ),
Format( "Fixed Dec", 5, 2 ),
Rotated Labels( "Perpendicular" )
);이게 도움이 되길 바란다.
최상의,
TS
Hi Pmroz,<BR />Script with JSL, <BR />Thank you,<BR />
// → Data Table( "GSB" )
Local( {obj},
obj = Data Table( "GSB" ) <<
Graph Builder(
Size( 604, 659 ),
Variables(
X(
Transform Column(
"Month Year[Date Measured]",
Ordinal,
Format( "m/y", 23 ),
Formula(
Date DMY(
1,
Month( :Date Measured ),
Year( :Date Measured )
)
)
)
),
Overlay( GSB Validation )
),
Elements(
Bar(
X,
Legend( 11 ),
Bar Style( "Stacked" ),
Summary Statistic( "% of Factor" ),
Label( "Label by Value" )
)
),
Local Data Filter(
Add Filter(
columns(
:"Inferred Value (Yes/No)"n,
Transform Column(
"Month Year[Date Measured]",
Ordinal,
Format( "m/y", 23 ),
Formula(
Date DMY(
1,
Month( :Date Measured ),
Year( :Date Measured )
)
)
)
),
Where( :"Inferred Value (Yes/No)"n == "Yes" ),
Where(
Transform Column(
"Month Year[Date Measured]",
Ordinal,
Format( "m/y", 23 ),
Formula(
Date DMY(
1,
Month( :Date Measured ),
Year( :Date Measured )
)
)
) == {3755376000, 3758054400, 3760473600, 3763152000, 3765744000,
3768422400, 3771014400, 3773692800, 3776371200, 3778963200,
3781641600}
),
Display(
Transform Column(
"Month Year[Date Measured]",
Ordinal,
Format( "m/y", 23 ),
Formula(
Date DMY(
1,
Month( :Date Measured ),
Year( :Date Measured )
)
)
),
N Items( 15 )
)
)
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Monthly GSB Validation (%)" )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "%" )} ),
Dispatch( {}, "Where((Inferred Value (Yes", TextBox, {Hide( 1 )} )
)
);
obj << Save Script to Data Table(
"Monthly GSB Validation (%)", <<REPLACE> = 12, y + 1, w/m >= 52, y - 1, y ) ) || If( w >= 10, "W", "W0" ) || Char( w ) ) ) ) ), Size( 570, 619 ), Variables( X( :"연도 주[측정 날짜]"n ), Overlay( :최고 제품 ) ), Elements( Bar( X, Legend( 2 )) , 막대 스타일( "누적형" ), 요약 통계( "요인 %" ), 레이블( "값별 레이블" ) ) ), 로컬 데이터 필터( 필터 추가( 열( :"연도 주[측정 날짜]"n ) , Where( :"연도주[측정 날짜]"n == {"2023W48", "2023W49", "2023W50", "2023W51", "2023W52", "2024W01", "2024W02", "2024W03", "2024W04 ", "2024W05", "2024W06", "2024W07", "2024W08"} ), Display( :"연도주[측정 날짜]"n, N 항목( 15 ), Find( 텍스트 설정( "" ) ) ) ) ), SendToReport( 발송( {}, "Where(연도 주[측정 날짜] = 2023W48, 2023W49, 2023W50, 2023W51, 2023W52, 2024W01, 2024W02, 2024W03, 2024W04, 2024W05, 2024W 06, 2024W07, 2024W08)", TextBox, { 숨기기( 1 )} ) ) );</REPLACE>