在 Power BI 中使用功能区图表Use ribbon charts in Power BI

备注

可以在 Power BI Desktop 和 Power BI 服务中创建并查看这些视觉对象。These visuals can be created and viewed in both Power BI Desktop and the Power BI service. 本文中的步骤和图示来自 Power BI Desktop。The steps and illustrations in this article are from Power BI Desktop.

可以使用功能区图表来直观显示数据,并快速发现哪个数据类别具有最高排名(最大值)。You can use ribbon charts to visualize data, and quickly discover which data category has the highest rank (largest value). 功能区图表能够高效地显示排名变化,并且会在每个时间段内始终将最高排名(值)显示在最顶部。Ribbon charts are effective at showing rank change, with the highest range (value) always displayed on top for each time period.

带状图

先决条件Prerequisites

本教程使用零售分析示例 PBIX 文件This tutorial uses the Retail Analysis sample PBIX file.

  1. 在菜单栏的左上方,选择“文件” > “打开” From the upper left section of the menubar, select File > Open

  2. 查找零售分析示例 PBIX 文件的副本Find your copy of the Retail Analysis sample PBIX file

  3. 在报表视图中打开零售分析示例 PBIX 文件 报表视图屏幕截图图标Open the Retail Analysis sample PBIX file in report view Screenshot of the report view icon..

  4. 选择Select 黄色选项卡的屏幕截图。 ,以添加新报表页。to add a new page.

创建功能区图表Create a ribbon chart

  1. 若要创建功能区图表,请在“可视化效果” 面板中选择“功能区图表” 。To create a ribbon chart, select Ribbon chart from the Visualizations panel.

    可视化效果模板

    功能区图表使用功能区在可视化时间连续区间内连接一个数据类别,从而使你可以看到某个给定的类别在图表的 x 轴(通常是时间线)范围内是如何排名的。Ribbon charts connect a category of data over the visualized time continuum using ribbons, enabling you to see how a given category ranks throughout the span of the chart's x-axis (usually the timeline).

  2. 选择“轴” “图例” 和“值” 的字段。Select fields for Axis, Legend, and Value. 在此示例中,我们选择了:“商店” > “开店日期”,“产品” > “类别”,以及“销售额” > “本年度销售额” > “值” 。In this example, we've selected: Store > OpenDate, Item > Category, and Sales > This year sales > Value.

    已选择字段

    由于数据集仅包含一年的数据,因此我们还从“轴”中删除了“年份”和“季度”字段 。Since the dataset contains data for only one year, we removed the Year and Quarter field from the Axis well.

  3. 功能区图表显示每个月份的排名。The ribbon chart shows rank for every month. 请注意排名如何随时间推移而变化。Notice how rank changes across time. 例如,从 2 月到 3 月,主页类别从第二个移动到第五个。For example, the Home category moves from second to fifth from February to March.

    带状图

设置功能区图表格式Format a ribbon chart

在创建功能区图表时,可以在“可视化效果” 窗格的“格式” 部分使用格式设置选项。When you create a ribbon chart, you have formatting options available in the Format section of the Visualizations pane. 功能区图表的格式设置选项类似于堆叠柱状图中的相应选项,只不过它还具有特定于功能区的其他格式设置选项。The formatting options for ribbon charts are similar to those for a stacked column chart, with additional formatting options that are specific to the ribbons.

可视化效果窗格中的功能区模板

功能区图表的这些格式设置选项可让你进行调整。These formatting options for ribbon charts let you make adjustments.

  • “间距”可调整功能区之间的间隔大小。Spacing lets you adjust how much space appears between ribbons. 数值为列的最大高度的百分比。The number is the percentage of the column's maximum height.
  • “匹配系列颜色”可以将功能区的颜色与系列颜色进行匹配。Match series color allows you to match the color of the ribbons with the series color. 设置为关闭时,功能区为灰色。 When set to off, ribbons are gray.
  • “透明度”指定功能区的透明度,默认设置为 30。Transparency specifies how transparent the ribbons are, with the default set to 30.
  • “边框”可以在功能区的顶部和底部使用深色边框。Border lets you place a dark border on the top and bottom of the ribbons. 默认情况下,边框为关闭状态。By default, borders are off.

由于功能区图表没有 y 轴标签,因此可能要添加数据标签。Since the ribbon chart does not have y-axis labels, you may want to add data labels. 从格式设置窗格,选择“数据标签” 。From the Formatting pane, select Data labels.

数据标签的格式设置选项

设置数据标签的格式设置选项。Set formatting options for your data labels. 在此示例中,我们将文本颜色设置为白色,并将显示单位设置为千。In this example, we've set the text color to white and display units to thousands.

可视化效果窗格中的功能区模板

后续步骤Next steps

Power BI 中的散点图和气泡图Scatter charts and bubble charts in Power BI

Power BI 中的可视化效果类型Visualization types in Power BI