Updated on 2024-06-21 GMT+08:00

Bar Chart

This section describes parameters of a bar chart.

Figure 1 Bar chart

Pattern

  • Size/Position
    • Size: width and height of the component. Unit: pixel.
    • Position: position where the component is located in the canvas. Unit: pixel.
  • Global Style

    Font: text font.

  • Column Style
    • Column Width: width of the column.
    • Column Angle: round-corner angle of the column.
    • Series Spacing: distance between series.
  • Margin
    • Top: spacing between the top sides of the chart and the component layer. You can enter a value or click to adjust the spacing.
    • Bottom: spacing between the bottom sides of the chart and the component. You can enter a value or click to adjust the spacing.
    • Left: spacing between the left sides of the chart and the component. You can enter a value or click to adjust the spacing.
    • Right: spacing between the right sides of the chart and the component. You can enter a value or click to adjust the spacing.
  • Value Tag
    • Value Tag: to show or hide the value tag by clicking or .
    • Font Size: font size of the value tag.
    • Color: font color of the value tag.
    • Font Width: font width of the value tag.
    • Position: position of the value tag. The options are Top, Align right, Inside, Align left, Bottom, Inside left, Inside right, Inside top, and Inside bottom.
  • X Axis
    • X Axis: to show or hide the X axis by clicking or .
    • Axis Label: text style of the X axis, including Data Type, Font Size, Color, Font Width, Angle, Inter-Label Clearance, Show Min. Label, and Show Max. Label.
    • Coordinate Axis: color of the X axis.
    • Grid Line: grid line color of the X axis.
    Figure 2 X axis of a bar chart
  • Y Axis
    • Y Axis: to show or hide the Y coordinate by clicking or .
    • Text: text style of the Y axis, including Font Size, Font Color, Font Width, and Angle.
    • Axis Label: text style of the Y axis, including Display Format, Min. Value, Max. Value, and Scales.
    • Axis Unit: unit of the Y axis.
    • Coordinate Axis: color of the Y axis.
    • Grid Line: grid line color of the Y axis.
    Figure 3 Y axis of a bar chart
  • Legend
    • Legend: to show or hide the legend by clicking or .
    • Text: text style of the legend, including Font Size, Color, and Font Width.
    • Layout: position where the legend is located.
    Figure 4 Legend of a bar chart
  • Message
    • Message: If you click , a message will pop up when you hover over a previewed or published component.
    • Triggering Mode: to set the triggering mode of messages. The options are Coordinate Axis and Data.
    • Color: font color of the message.
    • Font Size: font size of the message.
    • Font Width: font width of the message.
  • Animation
    • Click or next to Animation to hide or show animation, respectively.
    • Duration: duration of the first rendering of the component, in ms.
    • Animation Effect: The system provides multiple common animation slow-moving effects.
    • Animate in Order: If this option is selected, the series are animated in sequence. If this option is deselected, all series are animated at the same time.
    • Duration After Change: animation duration when the component data is updated, in ms.
    • Start from Previous Position: If this option is selected, the animation is played from the position of the previous data when the component data is updated. If this option is deselected, the animation is played from the initial position when the component data is updated.
    Figure 5 Animation (line chart)
  • Series to Category

    To convert series to category, click .

    • Display category: all series are displayed on the coordinate axis by category.
    • Display series: all categories are displayed on the coordinate axis by series.

    Assume that the first three records of the static data are modified as follows:

    [
      {
        "x": "Type A",
        "y": 78,
        "s": 1
      },
      {
        "x": "Type A",
        "y": 55,
        "s": 2
      },
      {
        "x": "Type A",
        "y": 68,
        "s": 3
      }
    
    ]

    On the Data panel, add three series whose values are 1, 2, and 3, and set different colors for the three series. Figure 6 shows the series, and Figure 7 shows the categories.

    Figure 6 Series of a bar chart
    Figure 7 Categories of a bar chart

Data

  • Data Source Type: to select the data source of the chart. Multiple data sources are provided for you to select. You need to add data sources first. For details, see Data Connection Overview.
  • Converter: Select a converter to convert data into the data that meets the display requirements. For details, see Using a Converter.
  • Data Mapping: The data format contains the following fields by default. Set the field names in the data source to which each field is mapped. If the field names are left empty, the field names are the same as those in the data source to which each field is mapped.
    • x: category, corresponding to the X axis.
    • y: data of series, corresponding to the Y axis.
    • s: series. You can set a value of the s field to a series. Multiple series can be added.

      Click on the right of s to add a series. To delete an added series, click on the right of the series.

      Add a series as follows:

      • Series Value: Enter a value of the s field. If the series value is empty, the value of the corresponding s field is used by default.
      • Series Name: self-definable. If the series name is empty, the series value is used as the series name by default.
      • Color: color of the column in the series.
      • Stack: stack name. You can enter a user-defined name. If the same stack name is set for different series (with different s values) of the same category (with the same x value), the series data is displayed in the stack.
      • Link: target link to which the web page points when a data item in component widget is clicked.
      • Link Mode:
        • New window: The target link opens a new browser window.
        • Current page: The target link opens a window in the current browser window.
        • Floating panel: The target link opens a floating window in the center of the current screen.
  • Automatic Update: If you select Automatic Update and set Update Interval, the data is automatically updated based on the interval.
  • Preview Result: Click Preview Result to view the information about the selected data source. You can click Update Query to manually update the component data when the data source changes.
Figure 8 Data panel of a bar chart

Interaction

For details about whether the component supports the interaction function and how to use the interaction function, see Configuring Component Interaction.