DataAnalysis provides 22 controls categorized into 7 types. You can choose the controls to use based on your business requirements. This topic describes how to add a line chart to a report, configure a data store for the line chart, and edit the line chart.

Go to the report editing page

  1. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region where the target workspace resides. Find the target workspace and click Data Analytics in the Actions column.
  2. On the DataStudio page, click the Icon icon in the upper-left corner and choose All Products > Data Development > DataAnalysis.
  3. On the DataAnalysis homepage, click Experience Now. The Web Excel page appears.
  4. In the All Reports section of the Report page, click the name of the report that you want to edit in the File Name column to go to the report editing page.

Add a line chart and configure a data store

  1. On the report editing page, click Tendency Chart and drag the Line Chart control to the canvas.
    Column chart
  2. On the Data Config tab on the right side of the report editing page, click Add.
  3. In the Create Pivot Table dialog box, specify the range of the data to be analyzed.
    You can set Choose Data to Select a spreadsheet or Use External Data Source as needed.
    • Select a spreadsheet
      You can specify a sheet from a workbook under the current account as the data store.Workbook
      Note A sheet of a pivot table cannot be used as the data store.
    • Use External Data Source

      Select a data store of the MaxCompute, Mysql, Data Services, OSS, or PostgreSQL type as needed. If you set Choose Data to Use External Data Source, make sure that the connection to the data store or the API for obtaining the source data has been configured. For more information, see Connection configuration.

    Multiple charts can use the same data store in different ways without affecting each other. One chart can use only one data store. After you select a chart and drag fields from the Pivot Table Fields section to the Data Config section, the chart is associated with the data store.

Configure data for the line chart

The parameters that need to be set vary with the chart type. For more information, see Charts. For example, you must specify the X-Axis and Y-Axis parameters for a line chart.

  1. On the right side of the report editing page, drag fields from the Pivot Table Fields section to X-Axis and Y-Axis in the Data Config section.
    Line chart

    You can choose whether to set the Split parameter based on your business requirements.

  2. Click Global Variable in the menu bar. In the Global Variable dialog box, specify Key and Value.
    In the Global Variable dialog box, you can specify custom filter conditions. For example, set Key to sex and Value to male. That is, set sex=male as the filter condition.Filter
  3. Click OK.
  4. On the right side of the report editing page, drag fields from the Pivot Table Fields section to Filter in the Data Config section.
  5. In the Screening dialog box, enter the variable name.
    Note Variable names are in the ${} format.
  6. Click OK. Only field values that meet the specified filter condition are displayed in the line chart.

Configure the line chart settings

To display the chart information more clearly, you can click the Component Config tab on the right side of the report editing page. On this tab, you can set the Title, Title Align, Show Polyline Points, Show Label and Show Legend parameters.Component Config

The parameters that need to be set vary with the control type. You can set the parameters based on the content to be displayed.