Star

ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform.

Share and embed Visualizations

All interactive visualizations created with the Trendz Analytics Platform could be shared with other users and embed on ThingsBoard Dashboards or external sites. In this guide, you will learn how to do this.

Share via ThingsBoard dashboard

You can share created visualizations or even provide a self-service interface for your users by adding Trendz widgets on ThingsBoard dashboards. Follow 2 simple steps to make it:

Import Trendz widget bundle

At the beginning you need to import Trendz widgets into your ThingsBoard installation:

This bundle contains 3 widgets:

Note: If after importing Trendz Widget Bundle into ThingsBoard, widgets do not work and white screen with error displayed - double-check that correct bundle was imported. Widget API in ThingsBoard v2.x and v3.x is different. Ensure that you downloaded bundle for the correct ThingsBoard version.

Add visualization on ThingsBoard Dashboard

Once widgets bundle imported and you already have saved Trendz Visualization - follow next steps to add them on the dashboard:

image

Use Dashboard alias in Trendz View

In this case you want to conect standard ThingsBoard widgets located on the dashboard with Trendz View. You can do this using ThingsBoard dashboard aliases and Trendz View - with filter alias from Trendz widget Bundle.

Example: we have 10 Machine devices in ThingsBoard. We want to create a dashboard that will show all Machine devices in a list and once device selected - other widget on the dashboard should show details about selected device. In total we will have 2 widgets on the dashboard:

On ThingsBoard side we setup a dashboard and add 2 widgets. Detailed instruction how to do this is not part of this tutorial, so here are brief steps:

image

On Trendz View side:

Return to ThingsBoard Dashboard:

image

image image

Now, every time when selected_device alias updated, value if its Entity Name would be inserted into Trendz View filter.

If multiple filters configured in Trendz View - system will match required filter by name.

Use Dashboard time window

By default, all Trendz visualizations use individual time range. However you can change this behavior and configure widget to toke time from ThingsBoard Dashboard. This option available for both, Static Trendz widget and for Trendz View with aliases.

image

Embed visualization on external site

You can also embed Trendz visualization into your web site by adding iFrame that points to required visualization.

Add iFrame on your site with the following URL http://{TRENDZ_URL}/viewMode/{VIEW_ID}?jwt={JWT_TOKEN}. Where:

Blocked View problem

If HTTPS was not enabled for Trendz it is possible that visuals shared on 3rd party websites or on ThingsBoard Dashboard would be blank.

The problem is that most browser block mixed content requests: if ThingsBoard use HTTPS and Trendz does not - browser will block requests to Trendz. You can find detailed error in browser console.

For fixing this - you need to enable HTTPS for Trendz UI. Find details how to do this in Trendz installation guide.