Grouped bar chart (v3.0 and later)

Updated at:

Learn about the chart style and configuration options for the grouped bar chart widget.

Important

This topic describes the configuration items for the grouped bar chart (v3.0 and later). For more information about versions earlier than v3.0, see Clustered column chart (earlier than v3.0).

Chart style

A grouped bar chart is a type of column chart that automatically groups and displays data by category, highlighting differences between and within categories. This chart type takes up a large amount of space in a visualization application.

image

Configuration panelimage

  • Search for Configurations: In the right-side panel of Canvas Editor, click the Settings tab, and click Search for Configurations in the upper-right corner. Enter the required configuration item in the search box, and click the search icon to quickly locate the configuration item. Fuzzy match is supported. For more information, see Search for Configurations.
  • Size: indicates the size of a widget, including its pixel width and height. You can click the Proportional resizing icon to proportionally adjust the width and height of a widget. After you click this icon again, you can adjust the width and height as needed.
  • Position: the position of a widget, which is indicated by pixel X and Y coordinates. X-coordinate indicates the pixel distance between the upper-left corner of the widget and the left border of the canvas. Y-coordinate indicates the pixel distance between the upper-left corner of the widget and the upper border of the canvas.
  • Rotation Angle: the angle of a rotation that uses the center point of a widget as the rotation point. The unit is degrees (°). You can use one of the following methods to control the rotation angle of a widget:
    • Directly enter the degrees in the Rotation Angle spin box or click the plus sign (+) or minus sign (-) to increase or decrease the value in the Rotation Angle spin box.
    • Drag the black dot in the Rotation control icon icon.
    • Click the Horizontal flip icon to horizontally flip a widget.
    • Click the Vertical flip icon to vertically flip a widget.
  • Opacity: the opacity of a widget. Valid values: 0 and 1. If this parameter is set to 0, the widget is hidden. If this parameter is set to 1, the widget is completely displayed. Default value: 1.
  • Chartimage

    • Margin: The distance between the column chart area and the top, bottom, left, and right borders of the widget. The unit is pixels (px).

    • Load Limit: The maximum number of data records to load for layout, rendering, and calculation. This limit helps maintain visualization application performance.

    • Column Style: The style of each column in the chart.

      Decoration

      Parameter

      Description

      Decoration Line

      The color of the decoration line.

      Decoration Shape

      The fill color and border color of the inner pentagon decoration.

    • Value Label: The style of the value label for each column. You can click the 开关图标 icon to show or hide the value labels.

      Parameter

      Description

      Text

      The font, weight, size, and color of the value label text.

      Position

      The position of the value label text. Options are Left, Center, and Right.

      Null Value Data

      When enabled, value labels are displayed even when the data is null. When disabled, value labels for null data are hidden.

    • Legend: The style of the chart legend. You can click the 开关图标 icon to show or hide the legend.

      Parameter

      Description

      Text

      The font, weight, size, and color of the legend text.

      Layout

      The position of the legend items relative to each other.

      • Spacing

        • Horizontal Spacing: The horizontal distance between adjacent legend items. This configuration is effective only when there are multiple series.

        • Vertical Spacing: The vertical distance between the legend and the top and bottom borders of the widget and chart.

      • Position: The position of the legend relative to the widget's origin. Options are Top Left, Top Center, Top Right, Bottom Left, Bottom Center, and Bottom Right.

  • Axes: The widget axes include the x-axis and the y-axis.

    • x-axisimage

      • Show x-axis: Turn on this switch to show the x-axis. Turn off this switch to hide the x-axis.

      • Range: The minimum and maximum values of the x-axis.

        Parameter

        Description

        Minimum

        The minimum value of the x-axis. You can enter a custom value or select a system option:

        • Auto Round: The system automatically calculates the value based on the maximum value, minimum value, and number of data points.

        • Data Minimum: Uses the minimum value from the data.

        Maximum

        The maximum value of the x-axis. You can enter a custom value or select a system option:

        • Auto Round: The system automatically calculates the value based on the maximum value, minimum value, and number of data points.

        • Data Maximum: Uses the maximum value from the data.

      • Axis Label: The style of the x-axis labels. You can click the 开关图标 icon to show or hide the x-axis labels.

        Parameter

        Description

        Display Format

        The display format for the x-axis label values. Options are Default, 11 (integer), 11.1 (floating-point number), 11.11 (floating-point number), 11%, 11.1%, and 11.11%.

        Text

        The font, weight, size, and color of the x-axis label text.

        Axis Label Display

        The number and unit of the x-axis labels.

      • Axis Line: The style of the x-axis line. You can click the 开关图标 icon to show or hide the x-axis line.

        Color: The color of the x-axis line.

      • Gridline: The style of the x-axis gridlines. You can click the 开关图标 icon to show or hide the x-axis gridlines.

        Color: The color of the x-axis gridlines.

    • y-axisimage

      • Show y-axis: Turn on this switch to show the y-axis. Turn off this switch to hide the y-axis.

      • Padding on Both Sides: The amount of padding at the top and bottom of the y-axis. The value ranges from 0 to 1.

      • Interval: The interval between columns on the y-axis. A larger value results in thinner columns and wider intervals. The value ranges from 0 to 0.95.

      • Axis Label: The style of the y-axis labels. You can click the 开关图标 icon to show or hide the y-axis labels.

        Parameter

        Description

        Text

        The font, weight, size, and color of the y-axis label text.

        Axis Label Display

        The angle of the y-axis labels. Options are Horizontal, Tilted, and Vertical. The number and unit of the y-axis labels.

      • Axis Line: The style of the y-axis line. You can click the 开关图标 icon to show or hide the y-axis line.

        Color: The color of the y-axis line.

      • Gridline: The style of the y-axis gridlines. You can click the 开关图标 icon to show or hide the y-axis gridlines.

        Color: The color of the y-axis gridlines.

  • Seriesimage

    • Series Value Mapping: Turn on this switch to enable Field Mapping Value for the series. Turn off this switch to disable Field Mapping Value.

    • Data Series: You can click the 加号图标 or 垃圾桶图标 icon on the right to add or delete a data series. You can click the 横排列图标 or 竖排列图标 icon to configure the arrangement of multiple data series. You can click the 复制图标 icon to copy the configuration of the selected data series and create a new series with the same configuration.

      Parameter

      Description

      Field Mapping Value

      The mapping value for the data series. This value can be customized. If it is empty, the system uses the value of the s field from the widget data as the series field mapping value. If it is not empty, you must ensure the order of the returned data.

      Display Name

      The display name for the data series. This name can be customized.

      Color

      The color of the columns in this series.

  • Others

    • Easing Animation: The animation effect for the column chart. You can click the 开关图标 icon to enable or disable the animation effect. 动画面板

      Parameter

      Description

      Animation Settings

      • Easing Effect: The easing effect for the animation. The system provides a variety of common animation easing effects for you to choose from.

      • Animate Series Sequentially: Turn on this switch to play the animation for each series sequentially. Turn off this switch to play the animation for all columns at the same time.

      Entrance Animation

      The duration of the animation when the widget is first rendered, in ms.

      Update Animation

      • Update Animation Duration: The duration of the animation when the widget data is updated, in ms.

      • Start from Previous Position: Turn on this switch to start the animation from the position of the previous data when the widget data is updated. Turn off this switch to start the animation from the initial position.

    • Tooltip: The style of the tooltip that appears when you hover over or click a column in the preview or on the published page. You can click the 开关图标 icon to enable or disable the tooltip.image

      Parameter

      Description

      Disappear Delay

      The delay before the tooltip disappears after the trigger condition is no longer met, in ms.

      Trigger Method

      • Trigger Type: The target type that triggers the tooltip. Options include Data Item and Axis.

      • Trigger Action: The action that triggers the tooltip. Options include Hover and Click.

      Text Style

      The style of the text in the tooltip, including the font, weight, size, and color.

      Background Box Style

      The style of the tooltip's background box.

      • Background Color: The background color of the tooltip.

      • Custom: The width and height of the tooltip, in px. Click the 开关图标 icon to enable or disable the custom tooltip.

      • Padding: The internal padding of the tooltip, in px.

      • Offset

        • Horizontal Offset: The horizontal offset of the tooltip relative to the mouse pointer, in px.

        • Vertical Offset: The vertical offset of the tooltip relative to the mouse pointer, in px.

      • Border

        • Border Weight: The thickness of the tooltip border, in px.

        • Border Color: The color of the tooltip border.

Data panel

image

Configuration field descriptions

Field

Description

x

The category of each column in the chart.

y

The value of each column in the chart.

s

(Optional) The corresponding series data.

Interaction panelimage

Select Enable to turn on the interaction feature for the widget. When you click a column in the grouped bar chart, a data request is triggered, a callback value is returned, and data for different columns is dynamically loaded. By default, the x, y, and s values from the data are returned. For more information about the configuration, see How to configure a callback ID for a ticker board widget.

Blueprint Editor interaction configuration

  1. In Canvas Editor, right-click a widget in the Layer panel and select Add to Blueprint Editor.
  2. Click the Blueprint Editor icon icon in the upper-left corner of the page.
  3. On the blueprint editor configuration page, click the Grouped Bar Chart widget in the imported nodes pane. The configuration parameters for the grouped bar chart in the blueprint editor appear on the canvas, as shown in the following figure.分组柱状图蓝图参数

    • Events

      Event

      Description

      On Grouped Bar Chart API Request Completion

      Triggered after the data API request succeeds and the returned data is processed by the filter. The processed data is returned in JSON format. For a data example, see the Data Response area on the Data tab of the widget's configuration panel in the canvas editor.

      When Grouped Bar Chart API Request Fails

      Triggered when the data API request fails (for example, due to network issues or API errors) and the returned data is processed by the filter. The processed data is returned in JSON format. For a data example, see the Data Response area on the Data tab of the widget's configuration panel in the canvas editor.

      When a Data Item is Clicked

      Triggered when a column in the grouped bar chart is clicked. The corresponding data item is also returned.

    • Actions

      Action

      Description

      Request grouped bar chart API

      Requests server-side data again. Data from input data processing nodes or layer nodes is passed as parameters. For example, if a grouped bar chart is configured with the API data source https://api.test and the data passed to the Request grouped bar chart API action is { id: '1'}, the final API request is https://api.test?id=1.

      Import grouped bar chart data

      Processes data according to the component's format, then imports the data to redraw the component. This action does not request data from the server again. For a data example, see the Data Response area on the Data tab in the component's configuration panel.

      Highlight

      Highlights the elements that correspond to the data items. The following code shows a data example.

      return {
        "data": {},
        "options": {
          "style": {
            "stroke": "#f00",
            "fill": ""
          },
          "selectMode": "single",
          "cancelHighlightFirst": false
        }
      }

      Remove highlight

      Removes the highlight from elements corresponding to the data items. The following code shows a data example.

      return {
        "data": {},
        "options": {
          "mode": "single"
        }
      }

      Clear component

      Clears the component's data. No parameters are required.

      Update component configuration

      Dynamically updates the component's style configuration. On the component's Configuration tab, click Copy Configuration to Clipboard to get the configuration data. Then, in the data processing node on the blueprint editor's configuration page, modify the field values as needed.

      Show

      Shows the component. The following code shows a data example.

      return{
        "animationType": "",
        "animationDuration": 1000,
        "animationEasing": "linear"
      }

      Hide

      Hides the component. The following code shows a data example.

      return{
        "animationType": "",
        "animationDuration": 1000,
        "animationEasing": "linear"
      }

      Toggle visibility

      Toggles the component between visible and hidden. The following code shows a data example.

      return {
        "animationIn": {
          "animationType": "",
          "animationDuration": 1000,
          "animationEasing": "linear"
        },
        "animationOut": {
          "animationType": "",
          "animationDuration": 1000,
          "animationEasing": "linear"
        }
      }

      Move

      Moves the component to a specified position. The following code shows a data example.

          return{      
            // The move method. Absolute positioning: to. Relative positioning: by. Default value: to.
              "positionType": "to",
            // The specified position. The x- and y-coordinates.
            "attr": {
              "x": 0,
              "y": 0
            },
            // The animation method.
            "animation": {
              "enable": false,
              // The animation delay.
              "animationDuration": 1000,
              // The animation curve. Optional values: linear, easeInOutQuad, or easeInOutExpo.
              "animationEasing": "linear"
            }
          }