JSL 如何在這樣的圖中實現點擊以取得變數值?請按照下面的腳本進行操作。
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
JSL怎麼寫 如何實現在圖中透過點擊某個年齡條,得到這個年齡值?並利用這個值來執行後續操作。
謝謝!

基礎資料分析與建模分享和交流成果回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?如果點選這個箭頭所指的空格,可以得到年齡值=14嗎?
這是滑鼠左鍵單擊,而不是懸停標籤。
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢???
frame = (p1 << report)[FrameBox( 1 )];
frame << Set Graphlet(
Picture(
dataage = Parse( age:_where );//??
d2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
d2 << Select Where( age == dataage );
d3 = d2 << Subset( Output Table( "test" ), Selected Rows( 1 ), selected columns( 0 ) );
Try( d3 << Delete Table Property( "Source" ) );
),
Reapply( 1 )
);
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?如果用Hover Labels觸發,為什麼只能在年齡==12時觸發開啟Big Class Families.jmp?
謝謝!
txt = "a";
Set Clipboard( txt );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
,
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
Set Textlet(
Setup(
expr = Parse( local:_where );
a = local:_dataTable << Get Rows Where( expr );
Set Clipboard( a[1] );
local:r = local:_dataTable << Get Rows Where( expr );
),
Markup( "{local:r}rows" )
)
)
)
);
txt = Get Clipboard();
frame = (p1 << report)[FrameBox( 1 )];
frame << Set Graphlet(
Picture(
dataage = txt; //Parse( age:_where );//??
d2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
d2 << Select Where( age == dataage );
d3 = d2 << Subset( Output Table( "test" ), Selected Rows( 1 ), selected columns( 0 ) );
Try( d3 << Delete Table Property( "Source" ) );
),
Reapply( 1 )
);
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible );
p1 = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
// this graphbuilder chart has multiple FrameBoxes. Get a list of them.
framelist = Report( p1 ) << XPath( "(//OutlineBox[text()='Graph Builder']//FrameBox)" );
// each framebox needs a graphis script with a Mousetrap to detect clicks.
For( iFrame = 1, iFrame <= N Items( framelist ), iFrame += 1,
frame = framelist[iFrame];
// the mousetrap needs to capture the iFrame value when it is
// built so it can report it later; use eval(evalexpr(...expr()...))
Eval(
Eval Expr(
frame << Addgraphicsscript(
Mousetrap(
{/*nothing on mouse drag, it happens a lot*/}//
, // but on mouse up, do something. MouseUp only happens once per click.
xx = x;
yy = y;
Show( xx, yy, Expr( iFrame ) );
// run your script here
)
)
)
);
);回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?感謝專家!
非常神奇,看到了 xx、yy 和 Expr(iFrame) 的變化。

回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?但為什麼這個腳本在JMP Pro 17.0中文版中不起作用呢?
贏10
謝謝!

回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?將我的 JMP 版本 17 設定為英文。
可以,但是日誌裡會有中文?
謝謝!

回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?好的
謝謝克雷格!
您教會了我如何解決問題,使我不再只是複製程式碼。
感謝專家!

回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?我抓住了這個
"(//OutlineBox[text()='Graph Builder']//FrameBox)"
從這裡
right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.right-click the outline triangle, choose Show Properties. Click one of the graphs.右鍵點選輪廓三角形,選擇“顯示屬性”。點擊其中一張圖表。
你可以將其簡化為
framelist = Report( p1 ) << XPath( "(//FrameBox)" );
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?仍然想透過點擊圖形來觸發腳本,而不是透過懸停標籤
但是這個圖形改變了形式,我不知道如何改變來寫JSL。
我不得不回到專家那裡。
謝謝!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p1 = dt << Graph Builder(
Size( 632, 1152 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements(
Bar( X, Y, Legend( 5 ), Bar Style( "Stacked" ), Response Axis( "X" ), Summary Statistic( "Sum" ) )
)
);
gp = Report(p1)["Graph Builder",FrameBox(1)]
Eval(
Eval Expr(
gp << Addgraphicsscript(
Mousetrap(
{},
a0 = Expr( iFrame );
dt << Select Where( :height == a0 );
dt << Select Columns( "height" );
d3 = dt << Subset( Output Table( "test" ), Selected Rows( 1 ), columns( height ) );
)
)
)
);回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?如果你懶得去酒吧 - 只是
- 添加熱圖
- 禁用 x 和 y 變數
- 並將透明度設為 0:
回覆: JSL是如何實現這樣一個圖中的點擊獲取變數值的呢?對於那些懶得點擊或懶得使用表達式處理的人:使用懸停標籤的圖片部分。
反應是立即的(比出現懸停標籤所需的時間快得多)。
dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :age ), Color( :sex ) ),
Elements( Bar( X, Y, Legend( 5 ), Response Axis( "X" ), Summary Statistic( "Sum" ) ) )
);
fbs = Report( gb ) << XPath( "//FrameBox" );
For Each( {fb}, fbs,
fb << Set Graphlet( Picture( Caption( Char( myAge = :age[local:_firstRow] ) ) ) )
);回覆: JSL如何在這樣的圖中實現點擊獲取變數值?