Real-time chart (old)

更新时间:
复制 MD 格式

The real-time chart component uses time as the X-axis to display real-time or historical data trends for one or more device properties. This topic explains how to configure this component.

Step 1: Add the component

  1. Create a web application. For more information, see Create a web application.

  2. In the Web application editor, click the component icon 组件 on the left.

  3. In the search box above the component list on the left, enter real-time chart to find the component, then drag it to the canvas.

    For more information about adding components, see Add a component.

    After adding the component, you can configure its size, position, and other basic styles in the properties panel on the right. From this panel, click Configure Data Source to specify the data for the chart.

Step 2: Configure the data source

  1. In the Style panel on the right side of the web application editor, click Configure Data Source next to Display Data.

  2. Configure the device data source parameters.

    In the Data Display · Data Source Configuration pop-up, set Mode to Multiple Devices, Single Property. For Product, select Soil Sensor. Use Specify Device to add the three devices soil_sensor_01, soil_sensor_02, and soil_sensor_03. Set Data Item to Historical Device Data and Property to Soil Temperature. Set Real-time Data Period to 1 day to now, and set Time Unit to 5 minutes. Click OK.

    Parameter

    Description

    Select data source

    Defaults to Device and cannot be changed.

    Mode

    Select the type of curve to display:

    • Single device, multiple properties: Displays data for up to 15 properties from a single device.

    • Multiple devices, single property: Displays data for a single property from up to 5 devices.

    Product

    Click Select Product to open the Select Product dialog box, then select your target product.

    The Select Product dialog box lists the products that have been imported into the project for the current application. If the product you need is not listed, click Product Management in the lower-left corner of the dialog box to navigate to the project's Products page to create or import a product.

    Device

    Select the device to bind.

    • Specify device: If a real device is connected to IoT Platform, select the real device. If the real device is not connected to IoT Platform and does not report data, use the device emulator to simulate data reporting online for data format validation. For more information, see Device emulator.

    • Dynamic device: You can select from four types of dynamic devices: page variables, component values, URL parameters, and data from interactive actions.

      • Page variable: Select a page variable that is created in the current application as the source of the dynamic device. For more information about how to create a page variable, see Manage page variables.

      • Component value: Select a configured form component in the current application as the source of the dynamic device.

      • URL parameter: Use a parameter on the final published page as the dynamic device for the service. This is often used for embedded pages where the host page provides dynamic parameters, such as using the incoming product model as the dynamic device for the service.

      • From interactive action: Use the pop-up window data source configured on the Interaction tab as the source of the dynamic device. For more information, see Open a pop-up container.

        Important
        • Only pop-up components support setting the dynamic device to From interactive action.

        • After you click Configure Data Source to open the Data Source Configuration pop-up window, you must set Device to Dynamic device.

    • Empty device: If you select this option, you can enter simulation data in the Device simulation data box to validate the data format.

    Data item

    Defaults to Historical Device Data and cannot be changed.

    This option displays the historical data of a property, for example, temperature data from the last 7 days.

    Property

    Select a device property. This component supports properties of the following data types: single-precision floating-point, double-precision floating-point, and integer.

    Real-time data period

    The following options are available:

    • A point in time to now: The available options are 1 hour, 0.5 days, 1 day, 2 days, 3 days, 4 days, 5 days, 6 days, 7 days, 15 days, and Custom (8, 9, 10, 11, 12, 13, or 14 days).

    • 00:00-24:00 for the current day.

    Time unit

    Select a time unit, which represents a time interval for data aggregation. The available time units depend on the selected Real-time data period:

    • If the period is 1 hour to now, 0.5 days to now, 1 day to now, or 00:00-24:00 for the current day, you can select 5 minutes, 10 minutes, or 1 hour.

    • If the period is 2 days to now or 3 days to now, you can select 30 minutes or 1 hour.

    • For other time periods, you can select 6 hours or 1 day.

  3. Click OK.

    By default, the component displays the real-time data curve from the configured data source.

Step 3: Configure styles

  1. In the Style panel on the right of the web application editor, configure the appearance of the component.

    Parameter

    Description

    Time selector

    Select this checkbox to add a historical data filter, which appears in the component's upper-left corner.

    Global style

    Set the global font, axis color, and background color for the chart.

    X-axis

    Select the Display Axis Labels checkbox to show the tick labels on the X-axis and Y-axis. You can also control the visibility of the labels by binding this option to a Boolean value from a data source. The data source can be a device, an API, static data, or an application push. A value of True shows the labels, and False hides them.

    After you enable the labels, you can configure their style.

    Note

    The number of Y-axis ticks is based on the range of values and the specified interval. For example, if the minimum value is 0, the maximum value is 500, and the interval is 50, the number of ticks is 11.

    Y-axis

    Border

    Set whether to display a border and configure its appearance.

    Guideline 1

    Guidelines are hidden by default. Enable a guideline to display it on the chart and configure its style.

    Guideline 2

    Display series name

    This checkbox is selected by default, displaying the series names (legend) above the chart. You can add series and configure the name and color for each.

    Note

    In the preview, you can click a series name in the legend to hide the corresponding curve on the chart.

  2. Adjust the component's position on the page. For more information about general component style settings, see Configure styles.

Step 4: Configure interactions

  1. In the Interaction panel on the right side of the web application editor, click Add Interaction, and then set an event and an action.

    This component supports the Mouse In event. For example, you can set the Mouse In event to trigger a Show/Hide action that reveals a hidden component with additional information.

    For more information, see Interaction configuration.

  2. Click Preview in the upper-right corner of the page to view and debug the component's data and style.