圖表中的標籤早安,
是否有 JSL 技巧來顯示我們可以選擇的某個值的標籤?對於此圖,我們將僅顯示最大值的標籤。
真摯地

數據探索和視覺化視窗回覆:圖表中的標籤嗨弗朗索瓦絲,
一個快速的解決方案是更改標籤的格式。透過點擊圖形產生器上的標籤格式(請參閱附圖)並新增適合您的公式,或使用 JSL 執行相同的操作。
Graph Builder(
Variables( X( :Xcolumn ), Y( :Ycolumn ) ), // Replace with your Columns
Elements(
Bar( X, Y,
Label( "Label by Value" ),
Label Format( "Custom", Formula( If( value > 17.5, value, " " ) ), 4, 0 ) // Here you can set your formula to change the label format
)
)
);
另一種方法可能是在資料表中建立一個額外的欄位(:Label Col)並將其新增至圖表。
我希望這有幫助。
最好的,
斯皮羅斯
回覆:圖表中的標籤另一個技巧:
對於線條,您可以新增標籤並選擇將顯示哪些值:

與標籤一起,將有以下行:

隱藏它的一種選擇:
調整標籤的顏色(例如黑色)並使用白色作為線條:

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Variables( X( :sex ), X( :name, Position( 1 ) ), Y( :height ) ),
Elements(
Line( X( 1 ), X( 2 ), Y, Legend( 1 ), Interval Style( "Arrow" ) ),
Bar( X( 1 ), X( 2 ), Y )
),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(
1,
Properties(
0,
{Line Color( 2 ),
Line Label Properties(
{Max Value Label( 1 ), Label Color( "Black" ), Width( 9 )}
)}
)
)}
)
)
);
回覆:圖表中的標籤你好,
感謝 Spyros 和 Hogi 的回答。
但很奇怪:當我使用spyros解決方案時,圖表中的標籤沒有相同的格式;請參閱腳本副本和圖表。
此致

回覆:圖表中的標籤我認為問題在於小數點的設定(在本例中為 0)在自訂標籤格式中不起作用。我的解決方法是採用全角 (12) 並將值四捨五入到首選的小數位數。
Graph Builder(
Variables( X( :Xcolumn ), Y( :YColumn ) ), //Replace with your columns
Elements(
Bar(X,Y,
Label( "Label by Value" ),
Label Format(
"Custom",
Formula( If( value > 1500, Round( value, 2 ), " " ) ), //here you can set your formula and Round the value to any number of decimal points
12, // full width
0
)
)
)
);
我還附上了一個包含腳本的範例表。我希望這能解決問題。
回覆:圖表中的標籤你好,
沒關係。
謝謝 ! 