大家好,
我的一位用户询问是否可以自动更改标题框中的标签以反映分类变量的不同值。
在提供的示例中,她希望看到“3”、“4”和“5”(或“因子的百分比(3)”等),而不是到处都使用相同的标签“因子的百分比”。这样会更容易理解。
我知道如何手动调整标签(通过编辑标签标题,如第二张图片所示),但是有没有办法自动执行这个过程?
期待您的见解!


脚本方法可以接受吗?如果可以,这里有一个自动化方法。只要用户不更改轴表的默认顺序,该方法就应该有效。
Names Default To Here( 1 );
//setup
dt = Open( "$SAMPLE_DATA/Tablet Production.jmp" );
gb = dt << Graph Builder(
Size( 525, 458 ),
Show Control Panel( 0 ),
Variables( X( :Lot Acceptance ), Overlay( :Screen Size ) ),
Elements(
Bar( X, Legend( 4 ), Bar Style( "Stacked" ) ),
Caption Box(
X,
Legend( 5 ),
Summary Statistic( "% of Total" ),
Location( "Axis Table" )
)
)
);
//get values for each axis row
lstScreenSize = Associative Array( :Screen Size ) << Get Keys;
//populate
For Each( {i, j}, lstScreenSize,
Report( gb ) << Dispatch( {}, "Lot Acceptance", ScaleBox,
{Label Row( j + 1, Row Title( "% of Total(" || i || ")" ) )}
)
);