大家好你们好!
我在制作饼图时遇到了一些问题.. 我在饼图中输入了值:“按总值的百分比标记”。 然而,其中一些数字是相互叠加的。 有谁知道如何移动它们?
太感谢了,
特蕾莎
有 3 种方法可以做到这一点:
- 使框架尺寸更大,直到没有重叠的文本。
- Main Menu > Preferences> Fonts > 将文本更改为较小的字体,不断更改直到没有重叠。 对于上一篇文章中的测试数据集,我不得不缩小到 7 号。您稍后必须将字体重置为默认值。
- 不要使用默认标签并编写自定义标签。 获取/计算中心径向线,使用角度写入标签。 这将很棘手,以确保字体从左到右和右侧向上。
这就是为什么我发现我之前发送的方法最容易做到的原因。
如果标签被覆盖,那么你一定有一些百分比非常小的组。 下面是一个使用 JSL 的示例,但您也可以通过点击来执行相同的操作。 如果你有非常小的百分比组,我建议你:
- 为您的组创建一个汇总表,选择 % of Total 作为汇总统计
- 选择列 % of Total 并从列菜单中选择标签
- 从行 > 选择 >选择哪里选择列 % of Total 并使用标准 > .02 或 > 2% 或您选择的某个百分比。
- 行 >标签
- 清除表格选择
- 现在创建您的饼图,表格标签将仅针对较大的组显示

这个脚本看起来很长,但是它正在创建表格;使用原始数据创建饼图;然后执行上述步骤。 请注意,该表是使用随机整数创建的,因此您的饼图将与上面显示的饼图不同。
Names Default to Here(1);
dt = New Table("Test", add rows(75), New Column("Age", numeric, formula(Random Integer(30,80))));
//create a Pie Chart using Pie chart Labels
gb1 = dt << Graph Builder(
Show Control Panel(0),
Size( 495, 440 ),
Show Control Panel( 0 ),
Variables( X( :Age ) ),
Elements( Pie( X, Legend( 6 ), Label( "Label by Percent of Total Values" ) ) )
);
//some labels are overwritten, only fix is to make the framesize larger or
//create custom labels with rotated text
//Alternative, create a summary table of categories, label the rows, do not label the
//rows with very small percentages
dtsum = dt << Summary(
Group( :Age ),
Name( "% of Total" ),
Freq( "None" ),
Weight( "None" )
);
//Make % of Total the label
dtsum:Name("% of Total") << Set Labelled;
//Label only larger %
dtsum << Select Where(:Name("% of Total") >=.02);
dtsum << Label;
dtsum << clear select;
//Create Pie Chart
gb2 = dtsum <<GRAPH builder=""></GRAPH>
您使用的是哪个版本的 JMP,您使用的是 GraphBuilder 还是 Chart 来创建饼图。