When adding a new chart, enable time series mode to better visualize trends in your query and analysis results over time.
Key concepts
Currently, only line chart (Pro) and flow chart (Pro) support time series mode.
Time series mode shows how one or more datasets change over time. It merges results from multiple queries to provide a more intuitive and detailed view of trends in your query and analysis results.
The time field is a default attribute for each log in Simple Log Service. It indicates the timestamp specified for a log when it is written to the service. The time field is a UNIX timestamp in seconds. You can use the time field to build charts in time series mode and avoid complex time function operations.
Time series mode differs from non-time series mode in the following ways:
-
Time series mode
-
The system automatically optimizes the time span for a more uniform time distribution.
-
Time is displayed in
mm:ssformat on the x-axis and inYYYY-MM-DD hh:mm:ssformat in the popover. -
Supports adding multiple queries and analyses.

-
-
Non-time series mode
-
The x-axis may have a wide and uneven time distribution.
-
The x-axis and popovers display time in the UNIX timestamp format. Changing the format requires using time functions in your query statement.
-
Supports only a single query and analysis.

-
Benefits
-
The uniform time distribution on the x-axis better reflects how metrics change over time.
-
The time scale on the x-axis automatically adjusts based on the time span, revealing more detail in the query and analysis results.
-
Displaying time on the x-axis in the
mm:ssformat provides a more intuitive view of the time span and detailed time points. -
Supports merging results from multiple queries and analyses.
Limitations
The x-axis time field must be in UNIX timestamp format (in seconds) or a standard time format. Standard time formats include UTC time (for example, 2022-02-03T22:30:05+08:00) or any format that can be parsed into year, month, day, hour, minute, and second components (for example, YYYY/MM/DD hh:mm:ss), which can include a time zone.
Configuration examples
Prerequisites
A Standard Logstore is created. For more information, see Create a basic logstore.
Logs are collected. For more information, see Data collection.
Indexes are configured. For more information, see Create indexes.
Example 1: Display daily PV and UV trends

You can enable time series mode and configure its settings when you create a chart. For more information about how to create a chart and configure a line chart, see Add a chart to a dashboard and Line Chart. The key configuration settings are as follows.
-
① Select the Logstore that contains your logs and enter a query statement.
* | select __time__ - __time__ % 3600 as time, COUNT(*) as pv, COUNT(DISTINCT remote_addr) as uv group by time order by time limit 10000-
time - time % 3600 as time specifies a time interval of 1 hour with the alias 'time'.
-
The remote_addr field indicates the IP address of the client, and you can use this field to count the number of unique visitors (UV).
-
Page views (PV) are calculated by counting the total number of logs.
-
-
② Set the time range to 1 Day(Relative).
-
③ Click Apply to run the query statement.
-
④ On the General Configurations tab, in the Query and Analysis Configurations section, set the Axis Y Field to pv and uv.
-
⑤ Turn on the Time Series Mode switch.
Example 2: Display inbound and outbound traffic trends

You can enable time series mode and configure its settings when you create a chart. For more information about how to create a chart and configure a line chart, see Add a chart to a dashboard and Line Chart. The key configuration settings are as follows.
-
① Select the Logstore that contains your logs and enter a query statement.
* | select __time__ - __time__ % 3600 as time , sum(body_bytes_sent)* -1 as net_out, sum(request_length) as net_in group by time order by time limit 10000-
time - time % 3600 as time represents a time interval of 1 hour, with 'time' as the alias.
-
The body_bytes_sent field indicates the number of bytes in the response body sent to the client. This field is used to calculate outbound traffic.
-
The request_length field indicates the size of the request in bytes, including the request line, request headers, and request body. This field is used to calculate inbound traffic.
-
-
② Set the time range to 1 Day(Relative).
-
③ Click Apply to run the query statement.
-
④ On the General Configurations tab, in the Query and Analysis Configurations section, set the Axis Y Field to net_out and net_in.
-
⑤ Turn on the Time Series Mode switch.