All Products
Search
Document Center

DataV:Echarts line chart

Last Updated:Apr 09, 2025

This topic describes the chart style and configuration panel of the Echarts line chart.

Chart style

image

Configuration Panel image

  • 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.
  • Render Engine: the rendering engine of the line chart. Including canvas and svg.

  • Legend: Click the Eye icon on the right to display the legend style. 图例

    • Horizontal Position: Click the drop-down list and select an alignment method for the legend and text.

      • Auto: By default, Auto is determined based on the position and orientation of the widget.

      • Left Align: If the graphic is on the left side of the text, it is left-aligned.

      • Align to Center: Align to Center if the legend graphic overlaps the text.

      • Right Align: If the graphic is on the right side of the text, it is right-aligned.

    • Vertical Position: Click the drop-down list and select an alignment method for the legend and text.

      • Auto: By default, Auto is determined based on the position and orientation of the widget.

      • Top Align: Top Align when the graphic is above the window.

      • Center: Center when the graphic is in the middle of the window.

      • Bottom Alignment: Bottom alignment when the graphic is below the window.

    • Orientation: Select the orientation of the legend from the drop-down list.

      • Horizontal: the horizontal distribution of the legend.

      • Vertical: The legend is distributed vertically.

    • Pin: Click the + or-sign or enter a number to adjust the inner margin of the legend. Unit: pixels. The default inner margin is 5.

    • Element Spacing: Click the + or-sign or enter a number to adjust the distance between each item in the legend. Horizontal spacing for horizontal layout, vertical spacing for vertical layout.

    • Text Style

      • Color: Modify the color of the legend text. For more information, see color picker description.

      • Font Style: the font style of the legend text.

      • Font weight: the font weight of the legend text.

      • Font: the font family of the legend text.

      • Font Size: Click + or-, or enter a value to change the font size of the legend.

  • Grid: Click the 箭头icon to display the grid style.

    • Left Margin: Click the + or-sign or enter a value to adjust the left margin of the grid. Unit: pixels.

    • Upper Margin: Click + or-, or enter a value to adjust the upper margin of the grid. Unit: pixels.

    • Right Margin: Click the + or-sign or enter a value to adjust the right margin of the grid. Unit: pixels.

    • Lower Margin: Click the + or-sign or enter a value to adjust the lower margin of the grid. Unit: pixels.

  • X Axis: Click the Eye icon to display the X axis. x轴

    • Position: specifies the position of the window on the x-axis.

      • Bottom: The position of the x-axis at the bottom of the window.

      • Top: The position of the x-axis on the top of the window.

    • Name: the name of the x-axis node.

    • Position: the position of the name on the x-axis. You can select Start, End, or Center. Default value: End.

    • Name Style

      • Color: Modify the color of the name text on the x-axis. For more information, see color picker description.

      • Font Style: the font style of the name on the x-axis.

      • Font weight: the font weight of the name on the x-axis.

      • Font: the font family of the name on the x-axis.

      • Font Size: Click + or-, or enter a value to modify the font size of the name on the x-axis.

    • Name Interval: Click the + or-sign or enter a value to change the distance between the axis and the axis.

    • Rotate Name: Click the + or-sign or enter a value to change the rotation angle of the axis name.

    • Reverse: If you select this check box, the axes are displayed in the reverse direction. If you remove this check box, the axes are displayed in the forward direction.

    • Leave White: If you select this check box, both sides of the axis are left blank. If you clear this check box, both sides of the axis are left blank.

    • Static: If you select this option, you cannot interact with the axes if they are static.

    • Axis: Click the eye icon on the right to display the x-axis.

      • On Zero: indicates whether the axis of the x-axis or y-axis is on the zero scale of the other axis. This field is valid only when the other axis is a value axis and contains the zero scale.

      • Line Style

        • Color: Modify the color of the x-axis line by referring to the color picker description.

        • Width: Click + or-, or enter a value to modify the width of the x-axis.

        • Type: the type of the axis. Optional. Valid values: Solid, Dashed, and Dotted.

        • Opacity: Click the + or-sign or enter a value to modify the transparency of the x-axis. The range is [0,1].

    • Tick mark: Click the eye icon on the right to display the scale on the x-axis.

      • Align with Labels: This option is valid when you select Leave White to ensure that the tick marks are aligned with the labels.

      • Internal: If you select this check box, the axis scale faces inward. If you remove this check box, the axis scale faces outward.

      • Length: Click the + or-sign or enter a number to modify the length of the scale.

      • Line Style

        • Color: Modify the color of the tick marks by referring to the color picker description.

        • Width: Click the + or-sign or enter a value to modify the width of the tick mark.

        • Type: the type of the axis. Optional. Valid value: Solid, Dashed, and Dotted.

        • Transparency: Click the + or-sign or enter a value to modify the transparency of the tick marks. The range is [0,1].

    • Scale Labels: Click the Eye icon on the right to display the scale labels on the x-axis.

      • Display Format: Set the display format of the scale labels, such as 06, 06:00, and 06 hours.

      • interval: The display interval of the scale labels on the axis. This parameter is valid in the category axis. By default, labels are displayed at intervals that do not overlap with each other. You can set it to 0 force all labels to be displayed. If you set this parameter to 1, one label is displayed every other label. If you set this parameter to 2, one label is displayed every other label.

      • Internal: If you select this check box, the axis labels face inward. If you remove this check box, the axis labels face outward.

      • Rotate: the rotation angle of the scale labels. If the category labels on the category axis cannot be displayed, you can rotate the scale labels to prevent them from overlapping. The angle of rotation ranges from -90 degrees to 90 degrees.

      • Outer Spacing: the distance between the scale label and the axis.

      • Show Minimum Label: If you select this option, the smallest scale label is displayed. By default, it is automatically determined that if the labels overlap, the smallest scale label will not be displayed.

      • Show Max Labels: If you select this option, the largest scale label is displayed. By default, it is automatically determined that if the labels overlap, the largest scale label will not be displayed.

      • Color: Modify the color of the scale labels for the axes. For more information, see color picker description.

      • Font Style: the font style of the axis labels.

      • Font weight: the font weight of the axis label text.

      • Font: the font family of the axis label text.

      • Font Size: the font size of the axis scale label text.

    • line separator: Click the eye icon on the right to display the line separator.

      • Line Style

        • Color: Modify the color of the x-axis line separator by referring to the color picker description.

        • Width: Click the + or-sign or enter a value to modify the width of the line in the x-axis line separator.

        • Type: the type of the x-axis line separator. Optional. The value can be Solid Line, Dashed Line, or Dotted Line.

        • Transparency: Click the + or-sign or enter a value to modify the transparency of the line separator on the x-axis. The value ranges from 0 to 1.

  • Y Axis: For more information, see X Axis.

  • dialog box: Click the eye icon on the right to display the dialog box. 提示框

    • Trigger Type: the type of the trigger. This parameter is optional. Default value: Axes.

      • Data Item: the data item graph trigger. It is used in charts that do not have a category axis, such as scatter charts and pie charts.

      • Axis: the axis trigger, which is used in column charts, line charts, and other charts that use category axes.

      • Do Not Trigger: Nothing is triggered.

    • Axis Indicator: Click the Eye icon to display the axis indicator.

      • Type: the type of the indicator. Valid values: Line Indicator, Shadow Indicator, and Cross Indicator.

      • Automatic Adsorption: If you select this check box, the axis indicator is automatically adsorbed to the point. This function is more meaningful on the numerical axis and the time axis, and can automatically find small numerical points.

      • Line Style

        • Color: Modify the color of the indicator line by referring to the color picker description.

        • Width: Click the + or-sign or enter a value to modify the line width.

        • Type: indicates the type of the line. Optional. The value can be Solid Line, Dashed Line, or Dotted Line.

        • Opacity: Click the + or-sign or enter a value to modify the opacity of the indicator line. The value ranges from 0 to 1.

      • Indicates the shadow style

        • Color: Modify the color of the shadow by referring to the color picker description.

        • Transparency: Click the + or-sign or enter a value to modify the transparency of the shadow. The value ranges from 0 to 1.

      • Indicates the cross style

        • Color: Modify the cross color by referring to the color picker description.

        • Width: Click the + or-sign or enter a value to modify the width of the line that indicates the intersection.

        • Type: indicates the type of intersection. Optional. Valid values: Solid, Dashed, and Dotted.

        • Transparency: Click the + or-sign or enter a value to modify the transparency of the intersection. The value ranges from 0 to 1.

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

      • Text Style

        • Color: Modify the color of the dialog box label text. For more information, see color picker description.

        • Font Style: dialog box the font style of the text.

        • Font weight: dialog box the font weight of the label text.

        • Font: dialog box the font family of the label text.

        • Font Size: dialog box the font size of the label text.

  • Series: Click the 加号图标or 垃圾桶图标icon to add or delete a conditional style. Click the 横排列图标or 竖排列图标icon to configure the arrangement style of multiple conditional styles. Click the 复制图标icon to copy the selected conditional style configuration and add a conditional style with the same configuration. 系列

    • Name: the name of the custom series. It must be used together with the s field value in the data.

    • Marker Graphic: the custom graphic. Default value: Circle. The tag types include None, Circle, Rectangle, Rectangle, Triangle, Diamond, Pushpin, and Arrow. For more information, visit the ECharts official website.

    • Marker Size: Click the + or-sign or enter a value to modify the size of the marker. Unit: pixels.

    • Rotation Angle: Click + or-, or enter a number manually to change the rotation angle of the marker. Unit: degrees.

    • Show Icon: Click the Eye icon to show the icon style.

    • Hover Animation: If you select this option, the animation effect is displayed when the hover switch is enabled.

    • Legend Interaction Highlight: If you select this check box, the interaction is highlighted when the legend hover is started.

    • Step Line Chart: Set the step style of the line chart, including Close, Turn at Current Point, Turn at Middle Point, and Turn at Next Point.

    • Label: Click the Eye icon to display the label style.

      • Position: Set the position of the label equivalent to the line chart, including but not limited to top, left, and inside.

      • Positioning Distance: Set the distance between the label and the border line on the line chart.

      • Rotate: the angle by which the labels are rotated. If the category labels on the category axis cannot be displayed, you can rotate the labels to prevent them from overlapping. The angle of rotation ranges from -90 degrees to 90 degrees.

      • Color: Modify the color of the label text. For more information, see color picker description.

      • Font Style: the font style of the label text.

      • Font weight: the font weight of the label text.

      • Font: the font family of the label text.

      • Font Size: the font size of the label text.

    • Element Style

      • Color: Modify the color of the element style by referring to the color picker description.

      • Transparency: Click the + or-sign or enter a value to modify the transparency of the intersection. The value ranges from 0 to 1.

    • Line Style

      • Color: Modify the color of the line. For more information, see color picker description.

      • Width: Click the + or-sign or enter a value to modify the width of the line.

      • Type: the type of the line. Optional. The value can be Solid Line, Dashed Line, or Dotted Line.

      • Transparency: Click the + or-sign or enter a value to modify the transparency of the line. The value ranges from 0 to 1.

    • Area Style

      • Color: Modify the color of the area style. For more information, see color picker description.

      • Transparency: Click the + or-sign or enter a value to modify the transparency of the area intersection. The value ranges from 0 to 1.

    • Smooth Curve: Click the + or-sign or enter a value to modify the smoothness of the line. Unit: %. The range is [0,1].

  • Animation: Select the check box to enable animation.

  • Animation Duration: Click the + or-sign or enter a value to modify the duration of the initial animation. Unit: milliseconds.

  • Easement Effect: Select an easing effect for the data update animation from the drop-down list. The default value is cubicOut.

Data tab

image

Configuration field description

Parameter

Description

x

Used to configure the category of each x-axis in a line chart, that is, the value of the x-axis.

y

Used to configure the value of each point in the line chart.

s

(Optional) The series value, used in conjunction with the series configuration items in the Style panel.

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 tab

image

Interaction description

Interaction

Description

When a data item is clicked

Select the Enable check box to enable interactions between widgets. The line chart component has an interactive configuration. When you click to select a data item, the callback value is returned. By default, the x and y fields in the data are returned. For more information, see How do I configure the callback ID of a token flip widget?

When the legend is clicked

Select the Enable check box to enable interactions between widgets. The line chart component has interactive configuration. When a legend is clicked, the callback value is returned. By default, the selected field in the data is returned. For more information, see How do I configure the callback ID of a token flip widget?

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 line chart in the Imported Nodes pane. You can view the line chart parameters in the canvas, as shown in the following figure. 蓝图

    • Event

      Event

      Description

      When the data 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 more information about specific data examples, see the Data Response Result section of the Data tab in the right-side configuration panel of the canvas editor.

      When a data interface request fails

      The event that is returned when a data interface request fails (the request may be due to network problems or interface errors) and is processed by the filter. The event also throws the processed JSON data. For more information about specific data examples, see the Data Response Result section of the Data tab in the right-side configuration panel of the canvas editor.

      When a data item is clicked

      The event that is raised when the line chart bar is clicked, along with the data item corresponding to that bar.

      When the legend is clicked

      The event that is raised when the line chart legend is clicked, along with the data item corresponding to that column.

    • Action

      Policy Action

      Description

      Request Data Interface

      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, line chart the API data source is https://api.test and the data transferred to the request data interface is { id: '1'}, the final request interface is https://api.test?id=1.

      Import data

      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 more information about specific data examples, see the Data Response Result section of the Data tab in the right-side configuration panel of the canvas editor.

      Highlight

      The input data of the action is of the object type. The parameters include seriesName (series name), seriesIndex (series index), dataIndex (data index), and name (data name). Sample data:

      {  
          "seriesName": "",  
          "seriesIndex": 1,  
          "dataIndex": 1,  
          "name": ""
      }

      Unhighlight

      The input data of the action is of the object type. The parameters include seriesName (series name), seriesIndex (series index), dataIndex (data index), and name (data name). Sample data:

      {  
          "seriesName": "",  
          "seriesIndex": 1,  
          "dataIndex": 1,  
          "name": ""
      }

      Display dialog box

      The input data of the action is of the object type. The parameters include dataindex (data index), name (data name), x (x-axis position), and y (y-axis position). Sample data:

      { 
          "dataIndex": 1,  
          "name": "",  
          "x": 1,  
          "y": 1
      }

      Hide dialog box

      Hide dialog box, no parameters required.

      Legend control

      The input data of the action is of the object type. The parameters include type (legend action type) and name (legend name). Sample data:

      {  
          "type": "legendToggleSelect",  
          "name": ""
      }

      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

      Displays the widget. The following example shows the reference data.

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

      Hide

      Displays the widget. The following example shows the reference data.

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

      Switch to the implicit state

      Specifies whether to show or hide a widget. The following example shows the reference data.

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

      Move

      Move a widget to a specified location. The following example shows the reference data.

          return{      
            // 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"
            }
          }