图表中的标签早上好,
是否有 JSL 技巧来显示我们可以选择的某个值的标签?对于此图,我们将仅显示最大值的标签。
真挚地

数据探索与可视化视窗回复:图表中的标签嗨,Françoise,
一种快速的解决方案是更改标签的格式。单击图形生成器上的标签格式(见附图)并添加适合您的公式,或使用 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
)
)
)
);
我还附上了包含脚本的示例表。希望这能解决问题。
回复:图表中的标签你好,
没关系。
谢谢 ! 