在数据表图形生成器脚本中用作轴最大值/最小值的变量
我的脚本中有以下几行,我正在保存到数据表中,然后运行以制作图形构建器图形。 当我从脚本运行图形时,它使用变量作为图形生成器的最大值和最小值,但如果我运行保存到数据表的脚本(比如我将表给其他人),它会使用默认的最大值和最小值。 有什么建议吗?
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 );