Bar Chart

更新时间:
复制 MD 格式

A bar chart displays trends over time and compares values across different categories. You can add data to a bar chart and configure its style.

Prerequisites

You have created a DataV screen. For more information, see Create a DataV screen.

Example

柱图

Add Data

  1. In the Charts tab of the Component library area, find the bar chart and drag it to the canvas.

    image.png

  2. Click Select a dataset, and follow the instructions in the figure below to add data. The updated icon is shown below.

    image.png

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

Configure Chart Styles

Position and Size

The configuration panel provides the following component settings:

  • Alignment (①): Adjusts the alignment of the component: left, center, or right.

  • Position (②): Sets the X and Y coordinate values to adjust the component's position relative to the top-left corner of the canvas.

  • Rotation (③): Sets the rotation angle of the component.

  • Size (④): Sets the width (W) and height (H) of the component.

  • Lock component (⑤): Locks the component to prevent changes to its size or position.

  • Opacity (⑥): Sets the transparency of the component.

image.png

Plot Area

The Plot area section provides the following settings:

  • Color palette: Sets the color scheme for the bars.

  • Bar orientation: Sets the orientation of the bars to horizontal or vertical.

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

  • Show data labels: Toggles the display of data labels. You can also configure the display mode (including showing all labels) and text style.

    When all data labels are shown, label positions are automatically adjusted to prevent overlap. Labels that extend beyond the axis area may be hidden. To override this behavior, select Allow data labels to overlap.

image

Legend

The Legend section provides the following settings:

  • Show legend: Toggles the display of the legend.

  • Position: Sets the position of the legend.

  • Text: Sets the font size and color of the legend text.

image.png

X-axis

The X-axis section provides the following settings:

  • Show X-axis: Toggles the display of the X-axis.

  • Axis title: Show or hide the axis title and its unit. If displayed, you can configure the title text, unit text, font size, and color.

  • Axis line: Show or hide the axis line. If displayed, you can configure its color.

  • Axis label and ticks: Show or hide the axis labels and ticks. If displayed, you can configure the text color of the labels and the style of the ticks.

  • Grid line: Show or hide the grid lines. If displayed, you can configure their width and color.

x轴

Y-axis

The Y-axis section provides the following settings:

  • Show Y-axis: Toggles the display of the Y-axis. You can also set its position, value range, and specify a maximum and minimum value.

  • Axis title: Show or hide the axis title and its unit. If displayed, you can configure the title text, unit text, font size, and color.

  • Axis line: Show or hide the axis line. If displayed, you can configure its color.

  • Axis label and ticks: Show or hide the axis labels and ticks. If displayed, you can configure the text color of the labels and the style of the ticks.

  • Grid line: Show or hide the grid lines. If displayed, you can configure their width and color.

Y轴

Tooltip

Configure how tooltips are displayed.

image.png

Parameter

Description

Display mode

Specifies the tooltip display mode: By data point or By dimension value.

Content

If Display mode is set to By data point, you can display the percentage.

If Display mode is set to By dimension value, you can display the total and the percentage.

Background color

Sets the background color of the tooltip.

Text

Sets the style of the tooltip text.

The following figure shows an example.

image.png

Series Settings

The Series settings section provides the following per-series settings:

Note

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

  • Select series: Selects a dimension or measure for the series.

  • Alias: Sets a display name for the field.

  • Show data labels: Configures the Value display format and Text style for the data labels. The value display format has two modes: Automatic and Custom.

    • Automatic (Default): The series value format inherits the data display format settings of the corresponding measure field.

    • Custom: Click the image icon to open the Data Display Format Settings dialog box and configure the data format. For more information, see Data display format > Custom.

  • Show maximum/minimum value: Toggles the display of the maximum and minimum values in the chart. You can configure the position, content, background color, and text style of the value labels.

  • Apply style to: Applies the current style to other measures.

image