如何在紅色參考線上添加標籤?你好,
如何向參考線添加標籤?
這是我的代碼:
有什麼建議嗎?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
sliderValue = 1;
dothisonchange = Function( {val},
tb << Set Text( "Cpk : " || Substr( Char( val ), 1, 4 ) )
);
Mean = 60;
std = 0.5;
New Window( "",
H List Box(
V List Box(
tb = Text Box( "Value: " || Char( sliderValue ) ),
sb = Slider Box(
1,
3,
sliderValue,
<<SET function=""></SET>
大規模定制回复:如何在紅色參考線上添加標籤?。
回复:如何在紅色參考線上添加標籤?刪除參考線在我的系統上運行良好。恢復軸的問題是,如果軸上的任何內容髮生更改,則運行恢復軸時它將返回到原始設置。因此,如果實際軸範圍或增量已更改,則恢復軸會將軸移回原始狀態。我認為您遇到的問題可能是時間問題,因此我添加了 Wait(0),我相信這可能會為您解決問題。此外,在將“權重”列添加到“變異性平台”後,您不再指向正確的圖表。更改後,輸出顯示結構也會更改。現在有兩個獨立的報告部門。
國標[1]
和
國標[2]
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
sliderValue = 1;
dothisonchange = Function( {val},
tb << Set Text( "Cpk : " || Substr( Char( val ), 1, 4 ) )
);
Flag = 0;
Mean = 60;
wMean = 105;
wstd = 2;
std = 0.5;
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
holdLL = LL;
holdUL = UL;
wLL = wMean - (sliderValue * 3 * wstd);
wUL = wMean + (sliderValue * 3 * wstd);
wholdLL = LL;
wholdUL = UL;
New Window( "",
H List Box(
V List Box(
tb = Text Box( "Value: " || Char( sliderValue ) ),
sb = Slider Box(
1,
3,
sliderValue,
sliderValue = sb << Get;
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
wLL = wMean - (sliderValue * 3 * wstd);
wUL = wMean + (sliderValue * 3 * wstd);
//Set the slider and call the other function
sb << Set( sliderValue );
gbfb1 = Report( gb[1] )[AxisBox( 1 )];
gbfb2 = Report( gb[2] )[AxisBox( 1 )];
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
wLL = wMean - (sliderValue * 3 * wstd);
wUL = wMean + (sliderValue * 3 * wstd);
//gbfb1 << revert axis;
try(gbfb1 << remove ref line(holdLL));
try(gbfb1 << remove ref line(holdUL));
try(gbfb2 << remove ref line(wholdLL));
try(gbfb2 << remove ref line(wholdUL));
wait(0);
If( Flag == 1,
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
gbfb2 << add ref line( wLL, Solid, red, "LL" );
gbfb2 << add ref line( wUL, Solid, red, "UL" );
);
holdLL = LL;
holdUL = UL;
wholdLL = wLL;
wholdUL = wUL;
dothisonchange( sliderValue );
),
Button Box( "Add Reference line",
If( Flag == 0,
Flag = 1;
gbfb1 = Report( gb[1] )[AxisBox( 1 )];
gbfb2 = Report( gb[2] )[AxisBox( 1 )];
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
wLL = wMean - (sliderValue * 3 * wstd);
wUL = wMean + (sliderValue * 3 * wstd);
try(gbfb1 << remove ref line(holdLL));
try(gbfb1 << remove ref line(holdUL));
try(gbfb2 << remove ref line(wholdLL));
try(gbfb2 << remove ref line(wholdUL));
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
gbfb2 << add ref line( wLL, Solid, red, "LL" );
gbfb2 << add ref line( wUL, Solid, red, "UL" );
dothisonchange( sliderValue );
)
)
)
),
V List Box(
gb = dt << Variability Chart(
Y( :height, : weight ),
X( :sex ),
Show Range Bars( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 )
);
)
);
請參閱新代碼以了解如何處理更改。
回复:如何在紅色參考線上添加標籤?@tx尼爾森刪除參考線不起作用。 我提出了恢復軸。
另一個問題:如果說,我正在運行 2 個高度和體重的變異性圖表,我想為它們添加參考線,並隨著滑塊框的變化而變化。 我該如何實現呢?
這是帶有恢復軸的代碼:我想向兩個變異性圖表添加參考線,並使用滑塊框改變參考線
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
sliderValue = 1;
dothisonchange = Function( {val},
tb << Set Text( "Cpk : " || Substr( Char( val ), 1, 4 ) )
);
Flag = 0;
Mean = 60;
std = 0.5;
LL = Mean - (sliderValue * 3 * 0.5);
UL = Mean + (sliderValue * 3 * std);
holdLL = LL;
holdUL = UL;
New Window( "",
H List Box(
V List Box(
tb = Text Box( "Value: " || Char( sliderValue ) ),
sb = Slider Box(
1,
3,
sliderValue,
sliderValue = sb << Get;
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
//Set the slider and call the other function
sb << Set( sliderValue );
gbfb1 = Report( gb )[AxisBox( 1 )];
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
gbfb1 << revert axis;
If( Flag == 1,
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
);
holdLL = LL;
holdUL = UL;
dothisonchange( sliderValue );
),
Button Box( "Add Reference line",
If( Flag == 0,
Flag = 1;
gbfb1 = Report( gb )[AxisBox( 1 )];
LL = Mean - (sliderValue * 3 * 0.5);
UL = Mean + (sliderValue * 3 * std);
gbfb1 << revert axis;
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
dothisonchange( sliderValue );
)
)
)
),
V List Box(
gb = dt << Variability Chart(
Y( :height, : weight ),
X( :sex ),
Show Range Bars( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 )
);
)
);回复:如何在紅色參考線上添加標籤?這是使用添加引用行來顯示動態行的代碼的修改

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
sliderValue = 1;
dothisonchange = Function( {val},
tb << Set Text( "Cpk : " || Substr( Char( val ), 1, 4 ) )
);
Flag = 0;
Mean = 60;
std = 0.5;
LL = Mean - (sliderValue * 3 * 0.5);
UL = Mean + (sliderValue * 3 * std);
holdLL = LL;
holdUL = UL;
New Window( "",
H List Box(
V List Box(
tb = Text Box( "Value: " || Char( sliderValue ) ),
sb = Slider Box(
1,
3,
sliderValue,
sliderValue = sb << Get;
LL = Mean - (sliderValue * 3 * std);
UL = Mean + (sliderValue * 3 * std);
//Set the slider and call the other function
sb << Set( sliderValue );
gbfb1 = Report( gb )["Graph Builder"][AxisBox( 2 )];
LL = Mean - (sliderValue * 3 * 0.5);
UL = Mean + (sliderValue * 3 * std);
Try( gbfb1 << remove ref line( holdLL ) );
Try( gbfb1 << remove ref line( holdUL ) );
If( Flag == 1,
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
);
holdLL = LL;
holdUL = UL;
dothisonchange( sliderValue );
),
Button Box( "Add Reference line",
If( Flag == 0,
Flag = 1;
gbfb1 = Report( gb )["Graph Builder"][AxisBox( 2 )];
LL = Mean - (sliderValue * 3 * 0.5);
UL = Mean + (sliderValue * 3 * std);
Try( gbfb1 << remove ref line( holdLL ) );
Try( gbfb1 << remove ref line( holdUL ) );
gbfb1 << add ref line( LL, Solid, red, "LL" );
gbfb1 << add ref line( UL, Solid, red, "UL" );
dothisonchange( sliderValue );
)
)
)
),
V List Box(
gb = dt << Variability Chart(
Y( :height ),
X( :sex ),
Show Range Bars( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 )
);
gb = dt << Graph Builder(
Size( 373, 325 ),
Show Control Panel( 0 ),
Variables( X( Transform Column( "Row", Formula( Row() ) ) ), Y( :height ) )
);
)
);回复:如何在紅色參考線上添加標籤?當變量發生變化時,滑塊腳本必須刪除之前的參考線並添加新線。
回复:如何在紅色參考線上添加標籤?我不確定您是否可以將圖形腳本移到框架框之外,但如果您可以將標籤放在框架框內

您可以將文本添加到圖形腳本中
Text Color("Red");
Text({0, LL}, "Lower");
Text({0, UL}, "Upper");回复:如何在紅色參考線上添加標籤?@傑德坎貝爾謝謝。 我想使用滑塊動態移動參考線。 添加參考線不會通過改變滑塊框動態移動。
回复:如何在紅色參考線上添加標籤?您可以使用“添加參考線”來解決該問題,而不是使用“添加圖形腳本”代碼嗎?
Graph Builder(
Transform Column( "Row", Formula( Row() ) ),
Variables( X( :Row ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch(
{},
"Row",
ScaleBox,
{Add Ref Line( LL, "Solid", "Black", "My Label", 1 )}
)
)
);回复:如何在紅色參考線上添加標籤?也許是這個:將參考線添加到圖表中
回复:如何在紅色參考線上添加標籤?