Dynamically show and hide widgets

Updated at:

This document describes how to dynamically show and hide widgets. The example uses a Tab List widget to control the visibility of an Area Chart widget and a Basic Column Chart widget.

Demonstration

  • Implementation of tab list IDsDynamic visibility

  • Using a carousel in a group仙音2_Trim

Procedure

  1. Log on to the DataV console.

  2. Select a visualization application and click Edit to open the canvas editor.

  3. Add a Tab List widget, an Area Chart widget, and a Column Chart widget to the canvas.

  4. In the Layers panel, select all widgets, right-click, and select Export to Blueprint Editor.

  5. Connect the widgets.image

  6. Configure the processing method for the branch judgment node.

    return data.id == 1; // Show the column chart
    return data.id == 2; // Show the area chart
    return data.id == 3; // Show all
  7. Click the image icon in the upper-right corner of the page to preview the results.1

  8. (Optional) Change the tab list data to have two values. Group the area chart and the column chart. In the Basic Settings of Carousel for Grouped Objects, set Trigger Method to Event Trigger.

  9. (Optional) Export the group to the blueprint editor and connect the nodes.

  10. (Optional) Configure the processing method for the serial data processing node.

    return {  index: data.id - 1 };
  11. (Optional) Click the image icon in the upper-right corner of the page to preview the results.2