Power BI 中的散佈圖與泡泡圖 (教學課程)Scatter charts and bubble charts in Power BI (Tutorial)

散佈圖一律會有兩個值座標軸,沿著水平軸顯示一組數字資料,沿著垂直軸顯示另一組數值。A scatter chart always has two value axes to show one set of numerical data along a horizontal axis and another set of numerical values along a vertical axis. 此圖表顯示 x 與 y 數交集處的點,結合這些值可形成單一的資料點。The chart displays points at the intersection of an x and y numerical value, combining these values into single data points. 視資料之不同,這些資料點可能平均散布或不平均地散佈在水平軸。These data points may be distributed evenly or unevenly across the horizontal axis, depending on the data.

泡泡圖會將資料點以泡泡取代,而泡泡的「大小」代表其他維度的資料。A bubble chart replaces the data points with bubbles, with the bubble size representing an additional dimension of the data.

您可以設定資料點數目You can set the number of data points

何時使用散佈圖或泡泡圖When to use a scatter chart or bubble chart

散佈圖極適合:Scatter charts are a great choice:

  • 顯示 2 (散佈圖) 或 3 (泡泡) 數值 之間的關聯性。to show relationships between 2 (scatter) or 3 (bubble) numerical values.
  • 將兩組數字繪製成一系列的 xy 座標。to plot two groups of numbers as one series of xy coordinates.
  • 當您想要變更水平軸的刻度時,取代折線圖。instead of a line chart when you want to change the scale of the horizontal axis
  • 將水平軸轉為對數刻度。to turn the horizontal axis into a logarithmic scale.
  • 顯示包含成對值或一組值的工作表資料。to display worksheet data that includes pairs or grouped sets of values. 在散佈圖中,您可以調整獨立的軸刻度,以顯示群組值的詳細資訊。In a scatter chart, you can adjust the independent scales of the axes to reveal more information about the grouped values.
  • 顯示大量資料的模式,例如,顯示線性或非線性趨勢、叢集與極端值。to show patterns in large sets of data, for example by showing linear or non-linear trends, clusters, and outliers.
  • 比較大量資料點,而不考慮時間。to compare large numbers of data points without regard to time. 您在散佈圖中包含的資料越多,就能做出越好的比較。The more data that you include in a scatter chart, the better the comparisons that you can make.

泡泡圖極適合:Bubble charts are a great choice:

  • 如果您的資料有 3 個資料數列,而每個數列包含一組值。if your data has 3 data series that each contain a set of values.
  • 呈現財務數據。to present financial data. 不同的泡泡大小很適合以視覺化方式強調特定值。Different bubble sizes are useful to visually emphasize specific values.
  • 與象限一起使用。to use with quadrants.

建立散佈圖Create a scatter chart

觀賞這段影片來了解 Will 如何建立散佈圖,然後依照下列步驟自行建立一個散佈圖。Watch this video to see Will create a scatter chart and then follow the steps below to create one yourself.

這些指示使用零售分析範例。These instructions use the Retail Analysis Sample. 若要跟著做,請針對 Power BI 服務 (app.powerbi.com) 或 Power BI Desktop 下載範例To follow along, download the sample for Power BI service (app.powerbi.com) or Power BI Desktop.

  1. 選取黃色加號圖示以建立空白的報表頁面Select the yellow plus icon to create a blank report page .

  2. 從 [欄位] 窗格選取下列欄位:From the Fields pane, select the following fields:

  3. 轉換成散佈圖。Convert to a scatter chart. 在 [視覺效果] 窗格中,選取散佈圖圖示。In the Visualization pane, select the Scatter chart icon.


  4. 將 [區域] 從 [詳細資料] 拖曳至 [圖例] 。Drag District from Details to Legend. 這會顯示沿著 Y 軸有繪製總銷售差異 % 的散佈圖,以及沿著 X 軸繪製每平方英呎銷售的散佈圖。This displays a scatter chart that plots Total Sales Variance % along the Y axis, and plots Sales Per Square Feet along the X axis. 資料點色彩代表區域:The data point colors represent districts:

現在讓我們加入第三個維度。Now let's add a third dimension.

建立泡泡圖Create a bubble chart

  1. 從 [欄位] 窗格中,將 [銷售] > [本年度銷售] > [值] 拖曳至 [大小] 區域。From the Fields pane, drag Sales > This Year Sales > Value to the Size area. 資料點會擴張為與銷售值成正比的數量。The data points expand to volumes proportionate with the sales value.

  2. 暫留在泡泡圖上。Hover over a bubble. 泡泡的大小反映 本年度銷售額的值。The size of the bubble reflects the value of This Year Sales.

  3. 若要設定泡泡圖中顯示的資料點數目,請在 [視覺效果] 窗格的 [格式] 區段中,展開 [一般] 卡片,並調整 [資料量]。To set the number of data points to show in your bubble chart, in the Format section of the Visualizations pane, expand the General card and adjust the Data Volume. 您可以將資料量上限設為任何大小,上限 10,000 (預設為 3500)。You can set the max data volume to any number up to 10,000 (default is 3500).



    因為資料點越多可能表示載入時間越長,所以,如果您選擇發佈限制規模較高的報表,請務必在 Web 及行動裝置上測式該報表,以及確保效能符合使用者的期望。Because more data points can mean a longer loading time, if you do choose to publish reports with limits at the higher end of the scale, make sure to test out your reports across the web and mobile as well to ensure performance matches your users' expectations. 注意,若資料點數目較多,您應以不同板型規格來測試結果,以確保效能良好。Note that for higher numbers of data points, you should test the results on different form factors to ensure good performance.

  4. 您可以將格式、視覺效果色彩、標籤、標題、背景等項目格式化You can format the visualization colors, labels, titles, background, and more. 若要改善協助工具,請考慮在每一行新增標記圖形。To improve accessibility, consider adding marker shapes to each line. 為每一行使用不同的標記圖形,可讓取用者更容易地區分不同的行 (或區域)。Using a different Marker shape for each line makes it easier for report consumers to differentiate lines (or areas) from each other. 若要選取標記圖形,請展開 [圖形] 並選取標記圖形。To select the marker shape, expand the Shapes card, then select a marker shape.


    您也可以將標記形狀變更為菱形、三角形或正方形:You can also change the marker shape to diamond, triangle, or square:


考量與疑難排解Considerations and Troubleshooting

散佈圖只有一個資料點Your scatter chart has only one data point

散佈圖有只有一個資料點,且彙總 X 軸與 Y 軸上的所有值嗎?Does your scatter chart have only one data point that aggregates all the values on the X and Y axes? 或其也許彙總單一水平或垂直線的所有值?Or maybe it aggregates all the values along a single horizontal or vertical line?

將欄位加入 [詳細資料] 區域,以告知 Power BI 如何將值分組。Add a field to the Details area to tell Power BI how to group the values. 此欄位對於您想要繪製的每個點都不得重複。The field must be unique for each point you want to plot.
像是簡單的資料列數目或 ID 欄位:Like a simple row number or ID field:

或者,如果您的資料中沒有它,請建立一個欄位,將 X 與 Y 值串連成每個點的獨特內容:Or if you don’t have that in your data, create a field that concatenates your X and Y values together into something unique per point:

若要建立新的欄位,請使用 Power BI Desktop 查詢編輯器新增索引資料行至資料集。To create a new field, use the Power BI Desktop Query Editor to add an Index Column to your dataset. 然後將本資料行加入您視覺效果的 [詳細資料] 區域。Then add this column to the Details area of your visualization.

後續步驟Next steps

Power BI 中的視覺效果類型Visualization types in Power BI

請試用 - 完全免費!Try it out -- it's free!

有其他問題嗎?More questions? 試試 Power BI 社群Try the Power BI Community