All Products
Search
Document Center

DataWorks:Visualize data on a dashboard

Last Updated:Mar 26, 2026

DataWorks DataAnalysis lets you run SQL queries against your data sources and turn the results into interactive charts. This tutorial walks through four visualization scenarios using processed user profile data stored in MaxCompute.

Prerequisites

Before you begin, make sure that you have:

  • Processed the required data using DataWorks DataStudio so that the ads_user_info_1d_spark table contains user profile data

  • Access to the DataWorks console

Scenarios covered

Scenario

Chart type

Numbers of registered members in different provinces and cities

Stacked Bar Chart

Distribution of page views (PVs) of members in different age ranges

Pie Chart

Distribution of PVs of members by gender

Pie Chart

Numbers of PVs of members by gender and zodiac sign

Grouped Column Chart

Step 1: Open the SQL Query page

  1. Log on to the DataWorks console.

  2. In the top navigation bar, select your region.

  3. In the left-side navigation pane, choose Data Analysis and Service > DataAnalysis.

  4. Click Go to DataAnalysis.

  5. In the left-side navigation pane, click SQL Query.

Step 2: Configure a data source

Before running a query, grant your account access to the data source and create an SQL query file.

Grant access to the data source

Go to Security Center, choose Security policy > Data query and analysis control, and click the Queryable data source tab. Find the data source you want to query, then click Authorization in the Actions column. For details, see Use the data query and analysis control feature.

Create an SQL query file

Use either of the following methods to create a temporary file:

  • If no file is open: Click Create SQL Query in the right-side area.

  • If a file is already open: Click the image.png icon to the right of the existing file name.

For more information, see SQL query.

Select a data source

On the configuration tab of the SQL query file, click the image.png icon in the upper-right corner. Select a workspace, a compute engine type, and a data source. This tutorial uses a MaxCompute data source.

Step 3: Query the data

On the configuration tab of the SQL query file, enter the following SQL statement and click the image.png icon to run the query.

-- If the desired partition is not found, run the show partitions tablename command to view available partitions.
select * from ads_user_info_1d_spark where dt='Data timestamp';

Replace 'Data timestamp' with an actual partition value (for example, '20241126') before running the query.

Step 4: Create and configure charts

After the query completes, click the image.png icon on the left side of the results area to switch to the chart view.

To open a chart's configuration tab, click the image.png icon in the upper-right corner of the chart.

image.png

All four scenarios follow the same configuration flow:

  1. Double-click the chart title to enter a custom title.

  2. Open Style Settings (right side of the configuration tab) and click Change Chart to select a chart type.

  3. Open Data Settings (left side of the configuration tab) and drag fields to the appropriate parameter slots.

  4. (Where needed) In Style Settings, go to Global Settings > Chart Information > Details > Chart Style to rename axis labels.

  5. Click Save in the upper-right corner.

Supported aggregation options

When you drag a numeric field to an axis or value parameter slot, you can choose an aggregation function from the drop-down list:

Aggregation

Description

Distinct Count

Counts the number of unique values

Sum

Adds all values in the field

The sections below describe the field mappings and chart type for each scenario.

Registered members by province and city

Chart type: Stacked Bar Chart

Data settings:

Axis

Field

Aggregation

X-axis

uid

Distinct Count

Y-axis

region

Axis labels:

Axis

Displayed title

X-axis

Number of Registered Members

Y-axis

Province

image.png

Final chart:

image.png

Page views by age range

Chart type: Pie Chart

Data settings:

Parameter

Field

Aggregation

Category

age_range

Value

pv

Sum

image.png

Final chart:

image.png

Page views by gender

Chart type: Pie Chart

Data settings:

Parameter

Field

Aggregation

Category

gender

Value

pv

Sum

image.png

Final chart:

image.png

Page views by gender and zodiac sign

Chart type: Grouped Column Chart

Data settings:

Parameter

Field

Aggregation

X-axis

gender

Y-axis

pv

Sum

Split

zodiac

Axis labels:

Axis

Displayed title

X-axis

gender

Y-axis

pv

image.png

Final chart:

image.png

What's next

  • Save and share: Click Save in the upper-right corner to permanently save a chart and share it.

  • Explore other chart types: Click Save As to create a copy of the current chart and reconfigure it with a different chart type.

  • View saved charts: In the left-side navigation pane of the DataAnalysis page, click Cards to see all charts saved with Save As.

image.pngimage.png