嗨,目前我創建了一個陣容框,其中包含幾個圖形(例如 3),彈出視窗後,我想透過 xpath 選擇每個圖形,然後執行一些操作,例如調整大小或添加參考線。
但是我發現我無法使用 for 循環單獨選擇陣容框中的圖表,我該怎麼辦?謝謝!
(我嘗試使用 gb1 = Graph Builder 1; gb2 = Graph Builder 2; gb3 = ... 但我不認為這是一種有效的方法。)
NW = New Window("GRA", LB = Lineup Box(N Col( 2 )));
LB << Append(
Graph Builder(
Variables(X,Y...
Graph Builder(
Variables(X,Y...
Graph Builder(
Variables(X,Y...
);
TotalGB = LB << xpath("//LineUpBox/Box"); # This is wrong for selecting graph object #
For( ii = 1, ii <= N Items(TotalGB), ii++,
TotalGB[ii] << Size( 800, 500 );
);如果您以這種方式添加它們,則可以在附加它們時建立引用(將它們收集到列表中而不是單獨的變數中)。如果你想使用 XPath 你可以這樣做
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
gbs = (lub << XPath("//OutlineBox[@helpKey = 'Graph Builder']")) << get scriptable object;
例如沒有 XPath
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
gbs = {};
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
show(gbs);