Stacked bar chart

Updated at:

A stacked bar chart shows trends over time for each data item and enables comparisons across items. This topic describes how to add data and configure styles for a stacked bar chart.

Prerequisites

You have created a dashboard. For more information, see Create a dashboard.

Example

堆积柱图

Add data

  1. In the component library, under Charts, find stacked bar chart and drag it onto the canvas.image.png

  2. Click Select a dataset and add data as shown in the figure below.image.png

You can also do the following with the data:字段设置

Configure chart style

Position and size

  • Adjust component alignment (①): Align the component left, center, or right.

  • Adjust component position (②): Set the X and Y coordinates relative to the top-left corner.

  • Adjust component angle (③): Set the rotation angle.

  • Adjust component size (④): Set the component's width (W) and height (H).

  • Lock the component (⑤): Prevents the component from being resized.

image.png

Plotting area

  • Color palette: Select the colors for the columns.

  • Column orientation: Set the column orientation to horizontal or vertical.

  • Column style: Set the column width and corner radius.

  • Show data labels: Shows or hides data labels. You can select the content to display (measure, percentage, or total), choose whether to show all labels, and configure the text style. When you select percentage, you can set the number of decimal places. The default is 2.

    When all data labels are shown, the system automatically adjusts their positions to prevent overlap. However, if there are too many data labels, some may not be displayed because they extend beyond the axis area. You can also select Allow data labels to overlap.

    Note

    If you select percentage, the data label format settings in series settings apply only to measure and total.

image

Legend

  • Show legend: Shows or hides the legend.

  • Position: Sets the legend's position.

  • Text: Configures the text style, such as font size and color.

图例

X-axis

  • Show X-axis: Shows or hides the X-axis.

  • Axis title: Shows or hides the axis title and its unit, sets their text, and configures the text style.

  • Axis line: Shows or hides the axis line and configures its color.

  • Axis labels and ticks: Shows or hides the axis labels and ticks, and configures the text color of the labels and the style of the ticks.

  • Gridlines: Shows or hides the gridlines and configures their width and color.

X轴

Y-axis

  • Show Y-axis: Shows or hides the Y-axis. You can also set its position and value range (minimum and maximum).

  • Axis title: Shows or hides the axis title and its unit, sets their text, and configures the text style.

  • Axis line: Shows or hides the axis line and configures its color.

  • Axis labels and ticks: Shows or hides the axis labels and ticks, and configures the text color of the labels and the style of the ticks.

  • Gridlines: Shows or hides the gridlines and configures their width and color.

Y轴

Tooltip

image

Parameter

Description

Display mode

Sets how the tooltip is displayed. Options are by single data point and by dimension value.

Content

The available content depends on the Display mode. If set to by single data point, you can show percentage. If set to by dimension value, you can show total and percentage.

Background color

Sets the background color.

Text

Configures the tooltip text style.

Series settings

Note

You can configure the Alias and Series Value Display Format in Series Settings only if Color Legend/Dimension is enabled in the Field configuration panel.

  • Select a series: Select a dimension or measure.

  • Alias: Set a custom display name for the field.

  • Show data labels: Configure the value display format and text style for the data labels. The value display format has two modes: Auto and Custom.

    • Auto (Default): Series values inherit the data display format settings of the corresponding measure field.

    • Custom: Click the image icon to open the Data display format settings dialog box, where you can customize the data format. For details on the available settings, see Data display format > Custom.

  • Sync style to: Applies the current conditional formatting to other measures.

image