您好 JMP 社区,
目前,我正在编写一个脚本,该脚本以预填充图形构建器的形式创建一个绘图模板以及其他内容。 脚本如下。 除了图中现有的 4 个信号之外,通常希望查看其他信号的用户应该使用开放图形构建器。 因此,他通常会开始拖动另一列并将其放在现有 4 个信号的顶部或底部。
问题是手动放置到 y 轴上的新信号被分配了标准颜色。 我希望图中的所有信号都具有由 :State 定义的相同颜色,无论有多少信号被拖放到 y 轴上并拖离 y 轴,而无需通过图例属性手动分配正确的颜色。
如何做到这一点?
谢谢
抢
Graph Builder(
Variables(
X( :Time ),
Y( :Signal 1 ),
Y( :Signal 2 ),
Y( :Signal 3 ),
Y( :Signal 4 ),
Color( :State )
),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 4 ) ) ),
Elements( Position( 1, 2 ), Line( X, Y, Legend( 5 ) ) ),
Elements( Position( 1, 3 ), Line( X, Y, Legend( 6 ) ) ),
Elements( Position( 1, 4 ), Line( X, Y, Legend( 7 ) ) ),
SendToReport(
Dispatch( {}, "Signal 3", ScaleBox, {Format( "Best", 12 )} ),
Dispatch( {}, "Signal 4", ScaleBox, {Format( "Best", 12 )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
4,
Properties( 0, {Line Color( 21 )}, Item ID( "Here", 1 ) ),
Properties( 1, {Line Color( 20 )}, Item ID( "are", 1 ) ),
Properties( 2, {Line Color( 41 )}, Item ID( "different", 1 ) ),
Properties( 3, {Line Color( 37 )}, Item ID( "labels", 1 ) ),
Properties( 4, {Line Color( 0 )}, Item ID( "for", 1 ) ),
Properties( 5, {Line Color( 32 )}, Item ID( "certain", 1 ) ),
Properties( 6, {Line Color( 1 )}, Item ID( "system", 1 ) ),
Properties( 7, {Line Color( 32 )}, Item ID( "states", 1 ) )
)}
)
)
)