Plotly.js on Losant

Hi all,
I am using Losant to monitor devices on a dashboard. There is an ability to create a custom widget on the dashboard using a 3rd party library(plotly). Unfortunately I can’t figure out how to code the data query on Losant to plot with plotly with the custom html ability.

Losant has given me some examples using other libraries but I am not very family with Java to make the connection with plotly implementation.

I have posted the same question to Losant, below was the response, however it still doesn’t seem clear to me


Welcome to the community! :slight_smile:

I have no experience with Losant, so maybe someone else can give you a more informed answer. From what I can see in their reply, they just provided you the query that you needed, so you get the values in two arrays.

All is left to do is to build the trace and create a new plot, as done in this simple example. I would assume that you can import Plotly from the CDN in the same script and somehow create a HTML div block for the chart in the dashboard, similar to the Chart.js example in the link you provided.

Hope this helps!

The folks at Losant took pity on me and posted a complete solution for me online. Works!