PowerApps 中的饼图控件Pie chart control in PowerApps

该控件用于显示与其他内容相比较的相对值。A control that shows relative values in comparison to each other.

说明Description

如果要从最左侧列中包含标签的表中显示相对数据,以及显示左起第二列中的值,请添加“饼图”控件。Add a Pie chart control if you want to show relative data from a table that contains labels in the leftmost column and values in the second column from the left.

关键属性Key properties

Items - 控件中显示的数据源,如库、列表或图表。Items – The source of data that appears in a control such as a gallery, a list, or a chart.

ShowLabels - 饼图是否显示与每个其楔形相关联的值。ShowLabels – Whether a pie chart shows the value that's associated with each of its wedges.

其他属性Additional properties

BorderColor – 控件边框的颜色。BorderColor – The color of a control's border.

BorderStyle – 控件边框是实线虚线点线还是BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – 控件边框的粗细。BorderThickness – The thickness of a control's border.

Color – 控件中文本的颜色。Color – The color of text in a control.

DisplayMode – 此控件是允许用户输入 (Edit)、仅显示数据 (View),还是已禁用 (Disabled)。DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – 控件的 DisplayMode 属性设置为 Disabled 时,该控件边框的颜色。DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

Explode - 饼图中楔形间的距离。Explode – The distance between wedges in a pie chart.

Font – 文本中所显示的字体系列的名称。Font – The name of the family of fonts in which text appears.

Height – 控件上边缘和下边缘之间的距离。Height – The distance between a control's top and bottom edges.

HoverBorderColor – 用户将鼠标指针停留在控件上时,该控件边框的颜色。HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

ItemBorderColor - 饼图中每个楔形周围边框的颜色。ItemBorderColor – The color of the border around each wedge in a pie chart.

ItemBorderThickness - 饼图中每个楔形周围边框的粗细。ItemBorderThickness – The thickness of the border around each wedge in a pie chart.

ItemColorSet – 图表中每个数据点的颜色。ItemColorSet – The color of each data point in a chart.

LabelPosition - 饼图中标签相对于楔形的位置。LabelPosition – The location of labels in a pie chart relative to its wedges.

OnSelect – 用户点击或单击某个控件时应用响应的方式。OnSelect – How the app responds when the user taps or clicks a control.

PressedBorderColor – 用户在点击或单击控件时,该控件边框的颜色。PressedBorderColor – The color of a control's border when the user taps or clicks that control.

Size – 控件上显示的文本的字号。Size – The font size of the text that appears on a control.

Visible – 控件显示还是隐藏。Visible – Whether a control appears or is hidden.

Width – 控件左边缘和右边缘之间的距离。Width – The distance between a control's left and right edges.

X - 控件左边缘与其父容器(如果没有父容器,则为屏幕)左边缘之间的距离。X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y - 控件上边缘与其父容器(如果没有父容器,则为屏幕)上边缘之间的距离。Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Max( DataSource, ColumnName )Max( DataSource, ColumnName )

示例Example

  1. 添加“按钮”控件,并将其 OnSelect 属性设置为以下公式:Add a Button control, and set its OnSelect property to this formula:
    Collect(Revenue2015, {Product:"Europa", Revenue:27000}, {Product:"Ganymede", Revenue:26300}, {Product:"Callisto", Revenue:29200})Collect(Revenue2015, {Product:"Europa", Revenue:27000}, {Product:"Ganymede", Revenue:26300}, {Product:"Callisto", Revenue:29200})

    不知道如何添加和配置控件Don't know how to add and configure a control?

    想要了解有关 Collect 函数或其他函数的详细信息?Want more information about the Collect function or other functions?

  2. 按 F5,单击或点击“按钮”控件,然后按 Esc 返回到默认工作区。Press F5, click or tap the Button control, and then press Esc to return to the default workspace.
  3. 添加饼图控件,然后将其 Items 属性设置为 Revenue2015Add a Pie chart control, and set its Items property to Revenue2015.

    饼图控件显示每个产品与其他产品之间相关的收入数据。The Pie chart control shows revenue data for each product in relation to the other products.