All Products
Search
Document Center

DataV:Scatter chart (V3.x)

Last Updated:May 17, 2023

A scatter chart is a chart that uses scatter points to display data. You can customize the x-axis, y-axis, and scatter point styles, configure multiple series of data, and display dialog box interaction and animation effects. It is suitable for displaying the differences of discrete data at different times. This article describes the meaning of each configuration items of a scatter chart..

Parameter

  • 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 asset 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.
  • Chart

    • Margin: the distance between the four directions of the chart and the border of the widget. Unit: pixels.

      Parameter

      Description

      Top

      The distance between the top of the chart and the upper boundary of the widget.

      Bottom

      The distance between the bottom of the chart and the lower boundary of the widget.

      Left

      The distance between the left side of the chart and the left boundary of the widget.

      Right

      The distance between the right side of the chart and the right border of the widget.

    • NULL Data: If you turn on the switch, all null data is displayed in the scatter points with a y-axis value of 0.

      Nullable data is defined as follows:

      • The data value is 0 or undefined.

      • The data is empty due to a missing data record in the series.

    • Maximum Load: You can specify the maximum number of input data records to be loaded. The system loads the maximum number of input data records for layout, drawing, and computing. This ensures the visual application.

    • Legend: the style of the legend. You can click the 眼睛图标icon to display or hide the legend.

      Parameter

      Description

      Text

      Set the style of the legend text, including the text font style, font size, font color, and font weight. For more information, see color picker instructions.

      Layout

      The positional relationship between the legends.

      • Spacing

        • Left and Right Spacing: The distance between the left and right sides of adjacent legends. This configuration items is only valid when there are multiple series.

        • Distance: the distance between the legend and the upper and lower boundaries of the widget.

      • Position: the position of the legend relative to the start coordinate of the widget. You can select Top Left, Top Center, Top Right, Bottom Left, Bottom Center, or Bottom Right.

  • Axis: You can select x-axis or y-axis.

    • x axis

      • X Axis Visible: If you turn on the switch, the x-axis style in the widget is visible. If you turn off the switch, the x-axis style in the widget is invisible.

      • Data Type: the type of the x-axis labeled data.

        Parameter

        Description

        Numeric Type

        Supports numeric data such as integers and floating-point numbers.

        Category Type

        Data of category types such as character and string is supported.

        Time Type

        The data of the time type needs to be configured data format.

        Leave blank on both sides

        The distance between the two sides of the x-axis. Valid values: 0 to 1.

        interval

        The percentage of the interval between two categories on the x-axis. The larger the value, the larger the percentage. Valid values: 0 to 1.

        Data Format

        Display format of data, valid only for time data, please configure by referring to %Y/%m/%d %H:%M:%S format.

        Scope

        Range values for the minimum and maximum values of the x-axis:

        • Maximum Value: the maximum value of the x-axis. You can specify a custom value. The default value is auto. The system automatically calculates the match based on the maximum value, minimum value, and number of tags.

        • Minimum Value: the minimum value of the x-axis. You can specify a custom value. The default value is auto. The system automatically calculates the match based on the maximum value, minimum value, and number of tags.

        Note

        The default values of the minimum and maximum values of the axis label are within a time range, which is consistent with the data x the field in the data panel. If the values in the Data panel conflict with the maximum and minimum values in the Configuration panel, the values in the Data range in the Configuration panel prevail.

      • Axis Label: the style of the x-axis label.

        Note

        If the data format and setting formats are not uniform, the widget will be displayed abnormally.

        Parameter

        Description

        Display Format

        The data format you want to display. This parameter is valid only for time-based and numeric data. Please refer to %m/%d%Y%H:%M:%S time, integer reference d and floating point reference .1f.

        Text

        The text of the x-axis label, including the font style, font size, font color, and font weight. For more information, see the color picker description. Modify the text color.

        Axis Label Display

        The display style of the x-axis label, including:

        • Angle: the angle of the x-axis label. Valides: Horizontal, Oblique, and Vertical.

        • Quantity: the number of labels on the x-axis.

        • Axis Unit: the unit of the x-axis label.

      • Axis: the style of the x-axis. You can click the 眼睛图标icon to display the x-axis.

        Color: the color of the x-axis.

      • Gridlines: the style of the x-axis gridlines. You can click the 眼睛图标icon to display or hide the x-axis gridlines.

        Color: the color of the x-axis grid lines.

    • Y axis

      • Y Axis Visible: If you turn on the switch, the y-axis style in the widget is visible. If you turn off the switch, the y-axis style in the widget is invisible.

      • Range: the range of the minimum and maximum values of the y-axis.

        Parameter

        Description

        Minimum

        The minimum value of the y-axis. You can customize the value or select the value.

        • 0: The default minimum value is 0.

        • Minimum Data Value: the minimum value in the data.

        • Automatic Rounding: The system automatically calculates the maximum value, minimum value, and the number of metric points in the data.

        Max Value

        The maximum value of the y-axis. You can customize the value or select the value.

        • Maximum Data Value: the maximum value in the data.

        • Automatic Rounding: The system automatically calculates the maximum value, minimum value, and the number of metric points in the data.

      • Axis Label: the style of the y-axis label. You can click the 眼睛图标icon to display or hide the y-axis label.

        Parameter

        Description

        Display Format

        The display format of the y-axis label value. Valid values: Default, 11 (integer), 11.1 (floating point), and 11.11 (floating point).

        Text

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

        Axis Label Display

        The display style of the y-axis label, including:

        • Angle: the angle of the y-axis label. Valid values: Horizontal, Tilt, and Vertical.

        • Quantity: the number of labels on the y-axis.

        • Axis Unit: the unit of the y-axis label.

      • Axis: the style of the y-axis. You can click the 眼睛图标icon to display the y-axis.

        Color: the color of the y-axis.

      • Gridlines: the style of the y-axis gridlines. You can click the 眼睛图标icon to display or hide the gridlines.

        Color: the color of the grid lines on the y-axis.

  • Series

    data series: Click the 加号图标or 垃圾桶图标icon on the right to add or delete a data series. Click the 横排列图标or 竖排列图标icon to configure the arrangement style of multiple data series.

    Parameter

    Description

    Series Name

    The name of the data series, which can be customized. If this parameter is empty, the system displays s field values in the component data as series names. If this parameter is not empty, you must ensure the order in which data is returned.

    Color

    The color of the lower scatter in this series.

    Stroke

    The color of the scatter stroke in this series.

  • Other scenarios

    • Easing Animation: the animation effect style of the scatter chart. You can click the 眼睛图标icon to enable or disable the animation effect.

      Parameter

      Description

      Animation Settings

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

      Admission Animation

      The duration of the first animation rendered by the component. Unit: ms.

      Update Animation

      Update Animation Duration: the duration of the animation when the widget data is updated. Unit: ms.

    • dialog box: the style of the dialog box that appears when you move the pointer over or click a hash on the preview or publish page. You can click the 眼睛图标icon to turn the dialog box on or off.

      Parameter

      Description

      Disappearing Delay Time

      When the trigger condition is not met, the dialog box will disappear. This configuration items sets the delay time before the dialog box disappears, in ms.

      Trigger Condition

      • Trigger Type: dialog box the type of the target to be triggered. This parameter is optional, including Data Item and Axis.

      • Trigger Action: dialog box the action to be triggered. This field is optional, including Hover and Click.

      Text Style

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

      Background Box Style

      The background box style of the dialog box.

      • Background Color: the background color of the dialog box.

      • Custom: the width and height of the dialog box. Unit: pixels. Click the 眼睛图标icon to turn custom dialog box on or off.

      • Pin: the inner margin of the dialog box. Unit: pixels.

      • Offset

        • Horizontal Offset: the horizontal offset of the dialog box relative to the mouse arrow. Unit: px.

        • Vertical Offset: the vertical offset of the dialog box relative to the mouse arrow. Unit: px.

      • Borders

        • Border Width: the border thickness of the dialog box. Unit: pixels.

        • Border Color: The border color of the dialog box.

The metadata of the filtering table.

散点图数据面板

Sample code in the preceding figure:

[
  {
    "x": "2010/02/01 00:00:00",
    "y": "175",
    "s": "1"
  },
  {
    "x": "2010/02/10 00:00:00",
    "y": "200",
    "s": "1"
  },
  {
    "x": "2010/03/01 00:00:00",
    "y": "125",
    "s": "1"
  },
  {
    "x": "2010/03/20 00:00:00",
    "y": "190",
    "s": "1"
  },
  {
    "x": "2010/04/01 00:00:00",
    "y": "190",
    "s": "2"
  },
  {
    "x": "2010/04/21 00:00:00",
    "y": "240",
    "s": "2"
  },
  {
    "x": "2010/04/30 00:00:00",
    "y": "225",
    "s": "2"
  },
  {
    "x": "2010/05/09 00:00:00",
    "y": "150",
    "s": "2"
  },
  {
    "x": "2010/05/31 00:00:00",
    "y": "230",
    "s": "2"
  },
  {
    "x": "2010/06/11 00:00:00",
    "y": "190",
    "s": "2"
  },
  {
    "x": "2010/06/30 00:00:00",
    "y": "275",
    "s": "3"
  },
  {
    "x": "2010/07/15 00:00:00",
    "y": "300",
    "s": "3"
  },
  {
    "x": "2010/07/21 00:00:00",
    "y": "375",
    "s": "3"
  },
  {
    "x": "2010/08/15 00:00:00",
    "y": "290",
    "s": "3"
  },
  {
    "x": "2010/09/01 00:00:00",
    "y": "190",
    "s": "3"
  },
  {
    "x": "2010/09/10 00:00:00",
    "y": "230",
    "s": "3"
  },
  {
    "x": "2010/10/29 00:00:00",
    "y": "325",
    "s": "3"
  },
  {
    "x": "2010/11/22 00:00:00",
    "y": "390",
    "s": "3"
  },
  {
    "x": "2010/11/30 00:00:00",
    "y": "290",
    "s": "3"
  },
  {
    "x": "2010/12/25 00:00:00",
    "y": "330",
    "s": "3"
  }
]
Table 1. Field description

Parameter

Description

x

The category of each scatter point, that is, the value of the x-axis. The field type and format must be consistent with the label data type and format on the x-axis in the configuration items.

y

The value of each scatter point, that is, the value of the y-axis.

s

Optional. The series value. This field value is used when the series name in the configuration items data series is empty.

Table 1. Parameters
ParameterDescription
Controlled ModeIf you turn on the switch, data is not requested when a widget is initialized. Data requests are triggered only based on callback IDs or the method configured in Blueprint Editor. If you turn off the switch, data requests are automatically triggered. By default, the switch is turned off.
Auto Data RequestAfter you select the Auto Data Request check box, you can enable dynamic polling, and manually specify the polling interval. If you do not select this check box, data is not automatically requested. You must manually refresh the page to request data or use Blueprint Editor or callback ID events to trigger data requests.
Data SourceIn the right-side panel of Canvas Editor, click the Data tab. Click Set next to Static Data. In the Configure Datasource panel, select a data source from the Data Source Type drop-down list. Enter code for data query in the code editor, click Preview Data Response to preview the response of the data source, and then view the response. For more information, see Configure asset data.
Data FilterIf you select the Data Filter check box, you can convert the data structure, filter data, and perform simple calculations. If you click the plus sign (+) next to Add Filter, you can configure the script for the data filter in the editor that appears. For more information, see Use the data filter.
Data Response ResultThe response to a data request. If the data source changes, you can click the Refresh icon icon next to Data Response Result to view the data response in real time.

Interaction

Select the Enable check box to enable interactions between widgets. When you click a scatter point in a scatter chart, a data request is triggered and a callback value is thrown to dynamically load data of different scatter points. By default, the x, y, and s values are returned. For more information, see Configure callback IDs.

Configure interactions in Blueprint Editor

  1. In Canvas Editor, right-click a widget in the Layer panel and select Add to Blueprint Editor.

  2. Click the 蓝图图标icon in the upper-left corner.

  3. In Blueprint Editor, click the Scatter Chart component in the Import Nodes pane. You can view the parameters of the Scatter Chart component on the canvas.

    • Event

      Event

      Description

      When the scatter chart interface request is completed

      The event is triggered with the processed JSON data after a data interface request is responded and processed by a filter. For specific data, see Data.

      When a data item is clicked

      The event that is raised when a scatter point in a scatter chart is clicked, and the data item corresponding to the scatter point is also raised.

    • Policy Action

      Policy Action

      Description

      Request Scatter Chart API

      This action is performed to request the server data again. The data sent by an upstream data processing node or layer node is used as a parameter. For example, if the API data source is http://api.test and the data passed to the Request Scatter Chart API action is { id: '1'}, the final request interface is http://api.test?id=1.

      Import a scatter chart

      After data of a widget is processed in accordance with its drawing format, the widget is imported for redrawing. You do not need to request server data again. For specific data, see Data.

      Highlight

      Highlight the element corresponding to the data item. Example:

      {
        data: {
          x: 'Shanghai' // You can list multiple highlight conditions, similar to filter. 
        },
        options: {
          style: {
            fill: 'red'
          },
          selectMode: 'single',
          cancelHighlightFirst: true
        }
      }

      Unhighlight

      Cancels the highlighting of the element corresponding to the data item. Example:

      {
        data: {
          x: 'Shanghai'
        },
        options: {
          mode: 'single' // If the value is single, only one highlight is canceled when multiple data items are hit. If the value is multiple, all highlights are canceled when multiple data items are hit. 
        }
      }

      Clear components

      Clear component data. No parameters are required.

      Update component configurations

      Style configurations of widgets are dynamically updated. Before this action is executed, you must click the widget in Canvas Editor, click the Settings tab in the right-side panel, and click Copy Configurations to... to obtain widget configurations. After that, change the style field for the data processing node in Blueprint Editor.

      Display

      A widget is shown without the need to specify parameters.

      Hide

      A widget is hidden without the need to specify parameters.

      Switch to the hidden state

      A widget is hidden or shown.

      Move

      A widget is moved to a specified location.

          {
            // The positioning type. to indicates absolute positioning, whereas by indicates relative positioning. The default value is to. 
              "positionType": "to",
            // The location, which is indicated by the x and y coordinates. 
            "attr": {
              "x": 0,
              "y": 0
            },
            // The animation type. 
            "animation": {
              "enable": false,
              // The duration in which animation is displayed. 
              "animationDuration": 1000,
              // The animation curve, which can be set to linear|easeInOutQuad|easeInOutExpo. 
              "animationEasing": "linear"
            }
          }