大家好你們好!
我在製作餅圖時遇到了一些問題.. 我在餅圖中輸入了值:“按總值的百分比標記”。 然而,其中一些數字是相互疊加的。 有誰知道如何移動它們?
太感謝了,
特蕾莎
有 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 來創建餅圖。