You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Visualization
Create a line chart with double Y-axes
Copy page
Download PDF
Create a line chart with double Y-axes
If you need to use a line chart to display different kinds or different scales of data, you can add multiple Y-axes to the line chart to display different data. This topic describes how to create a line chart withdouble Y-axis.​
Background Information​
TLS Line Chart supports adding multiple Y-axes to display data of different types or levels. For example, you can show the trend of PV and UV in a line chart. Since the orders of magnitude of PV and UV are usually quite different, when the two share a Y-axis, the UV trend shown in the line chart is not clear. At this time, you can add a double Y-axis, add a suitable Y-axis for PV and UV respectively according to their orders of magnitude, so as to better display their changing trends.​
Prerequisites​
  • The project and topic have been created and the log data has been successfully collected.​
Steps​
  1. Log on to the TLS console.​
  1. In the left-side navigation pane, choose Common Functions > Dashboard.​
  1. Find the target dashboard, then click the name of the dashboard.​
  1. In the dashboard, click Add chart .​
  1. In the destination chart, click Create chart .​
  1. In the Query analysis area, select the target topic, enter the following query and analysis statement, and then click Start analyzing .​
  • ​
    * | SELECT DATE_FORMAT(__time__ - __time__ % 300000, 'Y-M-d HH:mm') AS time, COUNT(*) AS PV, COUNT(DISTINCT(UID)) AS UV GROUP BY time ORDER BY time​
    ​
  1. In the Chart settings area, set the line chart.​
  • On Query and analysis field area, set the X-axis field source column to time, and set the Y-axis field source column to PV, UV. After the setting is completed, the change trend of PV and UV will be displayed on the page.​
  1. Add field configuration.​
  • In the Field Configuration tab, add a Y-axis for the UV column. For specific parameter descriptions, see Field configuration.​
  • ​图片​​
  • After the setup is complete, the line chart will have two Y axes, and the two Y axes are of different orders of magnitude, the left Y axis for PV and the right Y axis for UV, as shown in the figure below.​
  • ​图片​​
  1. Click Apply to dashboard to save the chart configuration.​
  1. Click Save to save the dashboard.​
​
Last updated: 2025.10.11 17:07:35