PowerApps 中的柱形图和折线图控件Column chart and Line chart controls in PowerApps

用包含 x 轴和 y 轴的图显示数据的控件。Controls that show data as graphs with x- and y-axes.

说明Description

默认情况下,“柱形图”或“折线图”控件包含多个组合在一起的控件。By default, a Column chart control or a Line chart control comprises multiple controls grouped together. 这些控件显示标题、数据和图例。These controls show a title, data, and a legend.

关键属性Key properties

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

NumberOfSeries - 柱形图或折线图中反映了多少列的数据。NumberOfSeries – How many columns of data are reflected in a column or line chart.

所有属性All 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.

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

GridStyle - 柱形图或折线图是显示 x 轴和/或 y 轴,还是两者都不显示。GridStyle – Whether a column or line chart shows its x-axis, its y-axis, both, or neither.

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.

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

ItemsGap - 柱形图中各柱形之间的距离。ItemsGap – The distance between columns in a column chart.

  • “ItemsGap”属性适用于“柱形图”控件,但不适用于“折线图”控件。The ItemsGap property is available for the Column chart control but not the Line chart control.

Markers - 柱形图或折线图是否显示每个数据点的值。Markers – Whether a column or line chart shows the value of each data point.

MarkerSuffix - 在“Markers”属性设为“true”的柱形图中,每个值后显示的文本。MarkerSuffix – Text that appears after each value in a column chart for which the Markers property is set to true.

  • “MarkerSuffix”属性适用于“柱形图”控件,但不适用于“折线图”控件。The MarkerSuffix property is available for the Column chart control but not the Line chart control.

MinimumBarWidth - 柱形图中的柱形宽度下限。MinimumBarWidth – The narrowest possible width of columns in a column chart.

  • “MinimumBarWidth”属性适用于“柱形图”控件,但不适用于“折线图”控件。The MinimumBarWidth property is available for the Column chart control but not the Line chart control.

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

PaddingBottom – 控件中的文本与该控件下边缘之间的距离。PaddingBottom – The distance between text in a control and the bottom edge of that control.

PaddingLeft - 控件中的文本与该控件的左边缘之间的距离。PaddingLeft – The distance between text in a control and the left edge of that control.

PaddingRight - 控件中的文本与该控件的右边缘之间的距离。PaddingRight – The distance between text in a control and the right edge of that control.

PaddingTop - 控件中的文本与该控件的上边缘之间的距离。PaddingTop – The distance between text in a control and the top edge of that control.

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

SeriesAxisMax - 柱形图或折线图 y 轴的最大值。SeriesAxisMax – The maximum value of the y-axis for a column or line chart.

  • “SeriesAxisMax”属性适用于“柱形图”控件,但不适用于“折线图”控件。The SeriesAxisMax property is available for the Column chart control but not the Line chart control.

SeriesAxisMin - 柱形图 y 轴的最小值。SeriesAxisMin – A number that determines the minimum value of the y-axis for a column chart.

  • “SeriesAxisMin”属性适用于“柱形图”控件,但不适用于“折线图”控件。The SeriesAxisMin property is available for the Column chart control but not the Line chart 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).

XLabelAngle - 柱形图或折线图的 x 轴下方的标签角度。XLabelAngle – The angle of the labels below the x-axis of a column or line chart.

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

YAxisMax - 折线图 y 轴的最大值。YAxisMax – The maximum value of the y-axis for a line chart.

  • “YAxisMax”属性适用于“柱形图”控件,但不适用于“折线图”控件。The YAxisMax property is available for the Column chart control but not the Line chart control.

YAxisMin - 折线图 y 轴的最小值。YAxisMin – The minimum value of the y-axis for a line chart.

  • “YAxisMin”属性适用于“柱形图”控件,但不适用于“折线图”控件。The YAxisMin property is available for the Column chart control but not the Line chart control.

YLabelAngle - 折线图或柱形图 y 轴旁边标签的角度。YLabelAngle – The angle of the labels next to the y-axis of a line or column chart.

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

示例Example

  1. 添加“按钮”控件,并将其 OnSelect 属性设置为以下公式:Add a Button control, and set its OnSelect property to this formula:
    Collect(Revenue, {Year:"2013", Europa:24000, Ganymede:22300, Callisto:21200}, {Year:"2014", Europa:26500, Ganymede:25700, Callisto:24700},{Year:"2014", Europa:27900, Ganymede:28300, Callisto:25600})Collect(Revenue, {Year:"2013", Europa:24000, Ganymede:22300, Callisto:21200}, {Year:"2014", Europa:26500, Ganymede:25700, Callisto:24700},{Year:"2014", Europa:27900, Ganymede:28300, Callisto:25600})

    不知道如何添加和配置控件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”属性设为“Revenue”,并将其“NumberOfSeries”属性设为“3”。Add a Column chart control or a Line chart control, set its Items property to Revenue, and set its NumberOfSeries property to 3.

    此控件将显示每个产品超过三年的收入数据。The control shows revenue data for each product over three years.