All Products
Search
Document Center

E-MapReduce:Data visualization

Last Updated:Mar 25, 2026

The DataAnalysis module in DataWorks includes a chart builder that converts SQL query results into interactive visualizations. This topic walks you through four chart configurations using user profile data: a stacked bar chart, two pie charts, and a grouped column chart.

Prerequisites

Before you begin, ensure that you have:

Visualization scenarios

The following table lists the four scenarios covered in this topic.

ScenarioChart type
Numbers of registered members in different provinces and citiesStacked Bar Chart
Distribution of page views of members in different age rangesPie Chart
Distribution of page views of members by genderPie Chart
Numbers of page views of members counted by gender and zodiac signGrouped Column Chart

Open SQL Query

Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Analysis and Service > DataAnalysis. On the page that appears, click Go to DataAnalysis. In the left-side navigation pane, click SQL Query.

Configure a data source

  1. Grant your account access to the data source. Go to Security Center and choose Security policy > Data query and analysis control. On the Queryable data source tab, find your data source and click Authorization. For details, see Use the data query and analysis control feature.

  2. Create a temporary file.

    • First visit or no file open: Click Create SQL Query in the right-side area.

    • Existing file already open: Click the image.png icon to the right of the current file name.

    For more information about SQL query files, see SQL query.

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

Query data

On the configuration tab of the SQL query file, enter the following SQL statement and click the image.png icon to run it. This example queries the dt="20241126" partition of the ads_user_info_1d_spark table.

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

Configure charts

After the query completes, click the image.png icon on the left side of the query result section to switch to chart view. To open the chart configuration tab, click the image.png icon in the upper-right corner of the chart.

image.png

The chart configuration tab has two panels:

  • Data Settings (left panel): Map query result columns to chart axes, categories, and values.

  • Style Settings (right panel): Change the chart type and configure visual appearance, including axis titles.

Numbers of registered members in different provinces and cities

  1. Double-click the chart title and enter a new title.

  2. In Style Settings, click the Change Chart tab and select Stacked Bar Chart.

  3. In Data Settings, drag the uid field to the X-axis area and select Aggregate > Distinct Count.

  4. Drag the region field to the Y-axis area.

  5. In Style Settings, click the Global Settings tab. In the Chart Information section, click Details and then click Chart Style.

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

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

  8. Click Save in the upper-right corner. Final chart:

    SettingValue
    Chart typeStacked Bar Chart
    X-axis fielduid — Aggregate: Distinct Count
    X-axis titleNumber of Registered Members
    Y-axis fieldregion
    Y-axis titleProvince

    image.png

    image.png

Distribution of page views by age range

  1. Double-click the chart title and enter a new title.

  2. In Style Settings, click the Change Chart tab and select Pie Chart.

  3. In Data Settings, drag the age_range field to the Category area.

  4. Drag the pv field to the Value area and select Aggregate > Sum.

  5. Click Save in the upper-right corner. Final chart:

    SettingValue
    Chart typePie Chart
    Category fieldage_range
    Value fieldpv — Aggregate: Sum

    image.png

    image.png

Distribution of page views by gender

  1. Double-click the chart title and enter a new title.

  2. In Style Settings, click the Change Chart tab and select Pie Chart.

  3. In Data Settings, drag the gender field to the Category area.

  4. Drag the pv field to the Value area and select Aggregate > Sum.

  5. Click Save in the upper-right corner. Final chart:

    SettingValue
    Chart typePie Chart
    Category fieldgender
    Value fieldpv — Aggregate: Sum

    image.png

    image.png

Page views by gender and zodiac sign

  1. Double-click the chart title and enter a new title.

  2. In Style Settings, click the Change Chart tab and select Grouped Column Chart.

  3. In Data Settings, drag the gender field to the X-axis area.

  4. Drag the pv field to the Y-axis area and select Aggregate > Sum.

  5. Drag the zodiac field to the Split area.

  6. In Style Settings, click the Global Settings tab. In the Chart Information section, click Details and then click Chart Style.

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

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

  9. Click Save in the upper-right corner. Final chart:

    SettingValue
    Chart typeGrouped Column Chart
    X-axis fieldgender
    X-axis titlegender
    Y-axis fieldpv — Aggregate: Sum
    Y-axis titlepv
    Split fieldzodiac

    image.png

    image.png

What's next

After configuring a chart, you have two save options:

  • Save: Permanently saves the chart so you can share it with your team.

  • Save As: Creates a copy of the chart, which lets you explore other chart types without modifying the original.

    image.png

To view all charts created with Save As, click Cards in the left-side navigation pane of the DataAnalysis page.

image.png