Bar Chart

更新时间:
复制 MD 格式

A bar chart visualizes two-dimensional datasets by comparing categories on one axis against their numerical values on the other. For example, you can display months on the horizontal axis and product sales on the vertical axis.

Prerequisites

A dashboard is created. For more information, see Create a dashboard.

Example

条形图

Add Data

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

  2. Click Select Dataset and follow the instructions in the figure below to add data. The updated icon is as follows.image.png

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

Chart Styles

Position and Size

Set the component's position, size, and appearance:

  • Align the component (①). Supported options: left, center, and right.

  • Set the component's position (②). Specify X-axis and Y-axis values, using the top-left corner as the origin.

  • Rotate the component (③). Specify the rotation angle.

  • Resize the component (④). Set the W (width) and H (height) values.

  • Lock the component (⑤). Locked components cannot be resized.

  • Set the opacity (⑥). Adjust the transparency level of the component.

image.png

Plot Area

Set the following plot area properties:

  • Color palette: Select the colors for the bars.

  • Bar display direction: Set the orientation of the bars to horizontal or vertical.

  • Bar style: Set the bar width, spacing between bars of the same group, and corner radius.

  • Show data label: Show or hide data labels, and set their display mode and text style.

    When all data labels are displayed, the system adjusts their positions to prevent overlap. Labels that extend beyond the axis area may not appear if there are too many. You can also enable Allow data labels to overlap.

image

Legend

Set the following legend properties:

  • Show legend: Show or hide the legend.

  • Position: Set the legend position.

  • Text: Set the legend text style, including font size and color.

图例

X-axis

Set the following X-axis properties:

  • Show X-axis: Show or hide the X-axis. You can also set a value range by defining minimum and maximum values.

  • Axis title: Show or hide the axis title and unit, and configure the title text, unit text, font size, and color.

  • Axis line: Show or hide the axis line and configure its color.

  • Axis label and tick: Show or hide axis labels and ticks, and configure the text color of the labels and the style of the ticks.

  • Gridlines: Show or hide gridlines and configure their width and color.

X轴

Y-axis

Set the following Y-axis properties:

  • Show Y-axis: Show or hide the Y-axis and set its position.

  • Axis title: Show or hide the axis title and unit, and configure the title text, unit text, font size, and color.

  • Axis line: Show or hide the axis line and configure its color.

  • Axis label and tick: Show or hide axis labels and ticks, and configure the text color of the labels and the style of the ticks.

  • Gridlines: Show or hide gridlines and configure their width and color.

Y轴

Tooltip

Set the tooltip display options.

image.png

Parameter

Description

Display mode

Specifies how tooltip information appears. Supported modes: By single data point and By dimension value.

Content

The By single data point mode supports percentages.

The By dimension value mode supports totals and percentages.

Background color

Sets the tooltip background color.

Text

Sets the tooltip text style.

The following figure shows an example tooltip.

image.png

Series Settings

Set the following series properties:

Note

You can set alias and series value display format in Series Settings only when Color Legend/Dimension is enabled in the Field configuration panel.

  • Select series: Select a dimension or measure field.

  • Alias: Set a custom name for the field.

  • Show data label: Configure the Value display format and Text style for data labels. The value display format supports Auto and Custom modes.

  • Show most value: Show or hide the maximum and minimum values in the chart. You can set the position, content, background color, and text style for the value labels.

  • Sync style to: Apply the current conditional format to other metrics.

image