在數據表圖形生成器腳本中用作軸最大值/最小值的變量
我的腳本中有以下幾行,我正在保存到數據表中,然後運行以製作圖形構建器圖形。 當我從腳本運行圖形時,它使用變量作為圖形生成器的最大值和最小值,但如果我運行保存到數據表的腳本(比如我將表給其他人),它會使用默認的最大值和最小值。 有什麼建議嗎?
min_val = col min(:col1);
max_val = col max(:col1);
// rest of graph builder function not included
Dispatch(
{},
"Y Axis Name",
ScaleBox,
{Min( min_val ), Max( max val )}
)
我已經嘗試了幾件事,但是創建 min_val 和 max_val 作為表變量並將它們傳遞給調度感覺是最有前途的,但沒有運氣——而是使用默認值 min 和 max。
提前致謝!
回复:在數據表圖形生成器腳本中用作軸最大/最小值的變量Send to Report() 和 Dispatch() 函數旨在供 JMP 使用以在平台中保存用戶定制。 腳本編寫者應該直接向對象發送消息。
Names Default to Here( 1 );
// get example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// pre-determine new scale
y min = 80;
y max = 100;
// launch Graph Builder
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
);
// get reference to report layer with display boxes
gb rep = gb << Report;
// send cascade of messages to y axis
Wait( 3 );
gb rep[AxisBox(2)]
<< Min( y min )
<< Max( y max );