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 – 控制項允許使用者輸入 (編輯)、只顯示資料 (檢視) 或者已停用 (停用)。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.

MarkerSuffixMarkers 屬性設定為 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屬性設定為 3Add a Column chart control or a Line chart control, set its Items property to Revenue, and set its NumberOfSeries property to 3.

    此控制項會顯示 3 年的每個產品營收資料。The control shows revenue data for each product over three years.