图表构建器脚本中未显示列切换器我编写了一个带有两个列切换器(用于 X 轴和 Y 轴)的图形构建器脚本。
代码运行没有错误,但是列切换器控件没有出现在图形用户界面中。
When I simplify to a standalone Graph Builder (outside New Window or New Script), the switchers appear normally.
Is there a known limitation or syntax nuance that causes Column Switcher not to render when used inside saved table scripts or New Window blocks?
示例(已匿名化,但结构相同):
// Visualization Script: KPI Trends by X-axis
Current Data Table() << New Script(
"Graphs: KPI v X-axis",
New Window("KPI Trends",
Graph Builder(
Size( 457, 346 ),
Fit to Window( "Off" ),
Variables(
X( :"X-axis Variable"n ),
Y( :"Primary Metric (%)"n ),
Overlay( :Batch_ID ),
Color( :Group_ID )
),
Elements(
Line( X, Y, Legend( 21 ) ),
Points( X, Y, Legend( 22 ) )
),
// Switch between time-based axes
Column Switcher(
:"X-axis Variable"n,
{:"X-axis Variable"n, :"Alternate X Variable"n}
),
// Switch between various KPIs on Y-axis
Column Switcher(
:"Primary Metric (%)"n,
{
:"Primary Metric (%)"n,
:"Metric_1 (unit)"n,
:"Metric_2 (unit)"n,
:"Metric_3 (unit)"n,
:"Metric_4 (unit)"n,
:"Metric_5 (unit)"n,
:"Metric_6 (unit)"n,
:"Metric_7 (unit)"n
}
//Retain Axis Settings( 0 ) // (Commented)
),
SendToReport(
Dispatch(
{},
"Primary Metric (%)",
ScaleBox,
{Min( 0 )}
)
)
)
)
);
笔记:
自动化和脚本编写数据探索与可视化回复:图表构建器脚本中未显示列切换器我快速浏览了一下你的脚本,不太确定哪里出了问题。日志里有任何输出吗?你是不是打开了多个表?运行表格脚本时,图表是否是从正确的表创建的?
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
dt << New Script("Graph",
New Window("",
Graph Builder(
Size(528, 448),
Show Control Panel(0),
Fit to Window("Off"),
Variables(X(:SITE), Y(:NPN1)),
Elements(Points(X, Y, Legend(3))),
Column Switcher(:NPN1, {:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4}),
Column Switcher(:SITE, {:lot_id, :wafer, :Wafer ID in lot ID, :SITE}),
SendToReport(
Dispatch(
{},
"NPN1",
ScaleBox,
{Min( 0 )}
)
)
)
)
);
回复:图表构建器脚本中未显示列切换器这段代码与参考脚本完全一致,运行正常。
我原以为这可能是版本特有的bug。
回复:图表构建器脚本中未显示列切换器我的示例脚本在我可以用来测试的版本上都能正常运行:JMP18.2.0、JMP18.2.1 和 JMP19.0.1
回复:图表构建器脚本中未显示列切换器我用你提供的列名创建了一个虚拟表,并运行了你提供的脚本。两个列切换器都按预期显示了。JMP 18.0.1