Configure the data source for a widget

更新时间:
复制 MD 格式

In DataV, you can configure a data source for an asset on the Configure Data Source page, where you specify the data source type and script, apply data filters, and preview data response results.

Configure a data source

  1. Log on to the DataV console.

  2. On the My Visualizations page, click Edit above the project that you created.
  3. In Canvas Editor, click an asset in the Layer column or on the canvas.
    Important Before searching for asset configurations, make sure that the corresponding assets have been added to your visualization application project. Otherwise, you need to add the assets first. For more information, see Asset management (Enterprise Edition).
  4. On the right of the canvas editor, click the Data icon.
  5. On the Data tab, click Set.
    Set Data Source
  6. In the Set Data Source pane, modify the data source type and script, configure a data filter, and preview the data response.

Modify the data source type and script

  1. In the Set Data Source pane, select a data source type from the Data Source Type list.
    For more information about the supported data source types and configurations, see Manage data sources.
    Note If you use an API data source, you can configure cross-origin access and obtain cookies of user clients. For more information, see How to configure cross-domain data and How to use cookies to isolate data in visualization applications.
  2. In the editing box, modify the data source script.
    In the lower-right corner of the editing box, click the Toggle Full Screen View icon to edit the data source script in full screen. Click the Copy icon to copy the data source script.
  3. After you configure the script, click Preview Data Response to preview the response result.
    Edit a data source

Configure a data filter

Use data filters to convert data structures, filter data, and perform simple calculations.

  1. In the Set Data Source pane, select Data Filter to enable the data filter function.
    Configure a data filter
  2. Click the plus sign (+) on the right to add a data filter.
  3. In the filter code editor, enter the filter code of the current asset data.
  4. Click Test to view the filter result.
    For more information about data filters, see Data filters.

View fields in the data response result

DataV assets typically return data response results in list form. The list shows the fields, mappings, and field descriptions of the asset. Fields in the data response result

View the data response result

In the Set Data Source pane, view the data response result in the Data Response Result section.

Data Response Result displays the data that the asset uses in real time. When the data source changes, the latest data is shown. If the response is delayed, click the Refresh icon on the right to refresh.

In the lower-right corner of the data editing box, click the Toggle Full Screen View icon to view the data response result in full screen. Click the Copy icon to copy the data response result. Data Response Result