All Products
Search
Document Center

E-MapReduce:Data visualization

Last Updated:Mar 26, 2026

Visualize user profile data using DataWorks DataAnalysis

DataWorks DataAnalysis lets you run SQL queries and turn the results into interactive charts without leaving the console. This tutorial walks you through four visualization scenarios using a sample user profile dataset.

By the end, you will have configured four charts — a stacked bar chart, two pie charts, and a grouped column chart — ready to save and share with your team.

Visualization scenarios

ScenarioChart typeWhy this chart type
Number of registered members by province and cityStacked Bar ChartComparing counts across many categorical values (regions)
Page view distribution by age rangePie ChartShowing proportional breakdown of a single metric
Page view distribution by genderPie ChartShowing proportional breakdown of a single metric
Page views by gender and zodiac signGrouped Column ChartComparing a metric across two dimensions simultaneously

Prerequisites

Before you begin, ensure that you have:

  • Completed the data processing step — the sample dataset (ads_user_info_1d_spark) must be available in MaxCompute

  • Access to the DataWorks console with permissions to use DataAnalysis

Open the SQL Query page

  1. Log on to the DataWorks console.

  2. In the top navigation bar, select the target 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.

Configure a data source

Grant data source permissions

To query a data source in DataAnalysis, your account must have the required permissions. To grant permissions:

  1. Go to Security Center.

  2. Choose Security policy > Data query and analysis control.

  3. On the Queryable data source tab, find the target data source and click Authorization in the Actions column.

For details, see Use the data query and analysis control feature.

Create a temporary file

Create an SQL query file to run your query:

  • First time: Click Create SQL Query in the right-side area.

  • Existing file open: Click the image.png icon to the right of the file name to create a new temporary file.

Note: 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.

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 it.

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

This query returns all columns from the ads_user_info_1d_spark table for the specified partition, including the fields used in the charts below: uid, region, age_range, pv, gender, and zodiac.

Build charts from query results

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

image.png

To configure a chart, click the image.png icon in the upper-right corner of the chart to open its configuration tab. Use Style Settings (right panel) to set the chart type and axis labels, and Data Settings (left panel) to map query fields to chart axes.

Number of registered members by province and city

A stacked bar chart works well here because it ranks and compares counts across many categorical values (provinces) at a glance.

  1. Double-click the chart title and enter a descriptive name.

  2. Set the chart type: in Style Settings > Change Chart, select Stacked Bar Chart.

  3. Map the data fields in Data Settings: image.png

    • Drag uid to the X-axis area. From the X-axis drop-down list, choose Aggregate > Distinct Count.

    • Drag region to the Y-axis area.

  4. Rename the axis labels: in Style Settings > Global Settings, click Details, then click the Chart Style tab.

    • In the X-axis section, click Axis Title and set Displayed Title to Number of Registered Members.

    • In the Y-axis section, click Axis Title and set Displayed Title to Province.

  5. Click Save in the upper-right corner.

    image.png

    image.png

Page view distribution by age range

A pie chart is the natural choice here — it highlights proportional shares of a whole, making it easy to see which age group drives the most page views.

  1. Double-click the chart title and enter a descriptive name.

  2. Set the chart type: in Style Settings > Change Chart, select Pie Chart.

  3. Map the data fields in Data Settings:

    • Drag age_range to the Category area.

    • Drag pv to the Value area. From the Value drop-down list, choose Aggregate > Sum.

  4. Click Save in the upper-right corner.

    image.png

    image.png

Page view distribution by gender

This chart follows the same pattern as the age range chart — a pie chart shows proportional shares, this time split by gender instead of age group.

  1. Double-click the chart title and enter a descriptive name.

  2. Set the chart type: in Style Settings > Change Chart, select Pie Chart.

  3. Map the data fields in Data Settings:

    • Drag gender to the Category area.

    • Drag pv to the Value area. From the Value drop-down list, choose Aggregate > Sum.

  4. Click Save in the upper-right corner.

    image.png

    image.png

Page views by gender and zodiac sign

A grouped column chart lets you compare page views across two dimensions (gender and zodiac sign) in a single view — grouping columns by one dimension and splitting by the other makes both dimensions visible without switching between charts.

  1. Double-click the chart title and enter a descriptive name.

  2. Set the chart type: in Style Settings > Change Chart, select Grouped Column Chart.

  3. Map the data fields in Data Settings: image.png

    • Drag gender to the X-axis area.

    • Drag pv to the Y-axis area. From the Y-axis drop-down list, choose Aggregate > Sum.

    • Drag zodiac to the Split area.

  4. Rename the axis labels: in Style Settings > Global Settings, click Details, then click the Chart Style tab.

    • In the X-axis section, click Axis Title and set Displayed Title to gender.

    • In the Y-axis section, click Axis Title and set Displayed Title to pv.

  5. Click Save in the upper-right corner.

    image.png

    image.png

Save and share charts

After configuring a chart, you have two options:

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

  • Save As: Click Save As if you want to visualize the data by using other types of charts.

    image.png

To view all saved chart cards, click Cards in the left-side navigation pane of the DataAnalysis page.

image.png