Data Management (DMS) provides the data visualization feature. When you configure data visualization, you can flexibly customize layouts and styles. This feature also provides a number of visualization components and built-in auxiliary widgets to help you configure dashboards and big screens.
Preparations
student_courses
table is created in advance, and some test data is inserted into the table. The following SQL statements are used to create the table and insert test data:/** Create a table. **/
CREATE TABLE `student_courses` (
`id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'Primary key',
`student_id` BIGINT(20) DEFAULT NULL COMMENT 'Student ID',
`course_id` BIGINT(20) DEFAULT NULL COMMENT 'Course ID',
`start_time` DATETIME DEFAULT NULL COMMENT 'Creation time',
`score` int(11) DEFAULT NULL COMMENT 'Examination score',
KEY `idx_student_course` (`student_id`,`course_id`),
KEY `idx_student_time` (`student_id`,`start_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table for data service tests';
/** Insert data. **/
INSERT INTO `student_courses` VALUES (1,1,1,'2020-11-24 11:19:54',78);
INSERT INTO `student_courses` VALUES (2,1,2,'2020-11-24 05:51:36',68);
INSERT INTO `student_courses` VALUES (3,1,3,'2020-11-24 05:28:08',60);
INSERT INTO `student_courses` VALUES (4,2,1,'2020-11-24 07:21:17',67);
INSERT INTO `student_courses` VALUES (5,2,2,'2020-11-24 02:07:52',91);
INSERT INTO `student_courses` VALUES (6,2,3,'2020-11-24 10:35:35',94);
INSERT INTO `student_courses` VALUES (7,3,1,'2020-11-24 03:19:03',53);
INSERT INTO `student_courses` VALUES (8,3,2,'2020-11-24 08:19:18',94);
INSERT INTO `student_courses` VALUES (9,3,3,'2020-11-24 02:04:17',89);
Procedure
- Step 1: Configure a dataset. Create a dataset based on the query results that are obtained after an SQL statement is executed to query data in a database.
- Step 2: Configure charts. Configure charts and their styles based on the dataset.
- Step 3: Configure a big screen. Add the charts to a big screen for display.
Step 1: Configure a dataset
- Log on to the DMS console V5.0.
- In the top navigation bar, click DTS. In the left-side navigation pane, choose .
- Click the Dataset tab. In the upper-right corner of the Dataset management page, click
.
- In the Writing SQL step, set the parameters and click Execute. The following table describes only some parameters that are involved in this example. For more information, see Create a dataset.
Parameter Description Name Required. The name of the dataset. In this example, the name is set to POC
.Description The description of the dataset. Database Required. The database to be queried. Select a database that you have the permission to query.
SQL statement Required. The SQL statement that you want to use to query data in the database. In this example, enter the following statement: SELECT * FROM `student_courses`;
. - After the SQL statement is executed, click Next Step.
- In the Edit dataset model step, set the Data type and Visualization type parameters for each field.
Parameter Description Data Type The type of the data in the field. Valid values: - Dimension: the scope, aspect, or angle of a measure.
- Measure: a statistical value that is obtained after an aggregation operation.
For example, to display the average scores of students, you can configure the
student_id
field as a dimension and thescore
field as a measure. For more information, see Terms.Visualization type The visualization type of the data in the field. Valid values: - Digital
- String
- Date
- Geography: Country
- Geography: Provinces
- Geography: City
- Click Save. The dataset is created, and you are navigated to the Dataset management page.
Step 2: Configure charts
In this example, two charts are configured: Students Score and AVG score of each course. In this example, only some of the involved parameters are described. For more information, see Manage charts.
- Log on to the DMS console V5.0.
- In the top navigation bar, click DTS. In the left-side navigation pane, choose .
- In the left-side navigation pane, click Chart.
- On the Chart management page, click the
icon.
- On the page that appears, configure a chart named Students Score.
- In the upper-left corner, enter a name for the chart. In this example, the chart name is set to
Students Score
. - In the left-side pane, click Select a dataset and select a dataset from the list. In this example, the POC dataset is selected.
- Drag the
student_id
field to the Dimension section on the Chart-driven tab. - Drag the
score
field to the Measure section on the Chart-driven tab, click thescore
field in the Measure section, and then select Average from the list. The default operation is Total. - On the Chart-driven tab, click the
icon.
- Drag the
course_id
field to the Grouping section on the Chart-driven tab. In the dialog box that appears, click Save. - Click the Style tab, select the Display label check box in the Label section, and then clear the Show legend check box in the Legend section.
- Click Save.
- In the upper-left corner, enter a name for the chart. In this example, the chart name is set to
- You are navigated to the Chart management page. Click the
icon.
- On the tab that appears, configure a chart named AVG score of each course.
- In the upper-left corner, enter a name for the chart. In this example, the chart name is set to
AVG score of each course
. - In the left-side pane, click Select a dataset and select a dataset from the list. In this example, the POC dataset is selected.
- Drag the
course_id
field to the Dimension section on the Chart-driven tab. - Drag the
score
field to the Measure section on the Chart-driven tab, click thescore
field in the Measure section, and then select Average from the list. - On the Chart-driven tab, click the
icon.
- Click the Style tab and select the Display label check box in the Label section.
- Click Save.
- In the upper-left corner, enter a name for the chart. In this example, the chart name is set to
Step 3: Configure a big screen
DMS provides dashboards and big screens for you to display business information. This example describes how to configure a big screen on which data is updated at regular intervals. For more information, see Manage dashboards and Manage big screens.
- Log on to the DMS console V5.0.
- In the top navigation bar, click DTS. In the left-side navigation pane, choose .
- In the left-side navigation pane, click Data display.
- On the Resource management page, click New big screen.
- In the New Big Screen dialog box, enter a name for the big screen in the Name field and click Save. In this example, enter
Students Score
. - Add charts to the big screen.
- Add auxiliary widgets to the big screen, such as rectangles, labels, videos, and timers.
- In the upper part of the page, click the
icon and select Label from the list.
- In the Layer pane, select the label that you added in the previous step. On the big screen, move the label below the
Students Score
chart. Then, in the Label pane, enterStudents Score
in the Text content field. - In the upper part of the page, click the
icon and select Label from the list.
- In the Layer pane, select the label that you added in the previous step. On the big screen, move the label below the
AVG score of each course
chart. Then, in the Label pane, enterAVG score of each course
in the Text content field.
- In the upper part of the page, click the
- In the upper part of the tab, click the
icon.
The following figure shows the preview effect of the big screen. - Share the big screen.
- In the upper part of the page, click the
icon.
- In the dialog box that appears, click Open sharing.
- Click Copy Link and share the link with other users within your Alibaba Cloud account.
- In the upper part of the page, click the