This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Embed Your ThingSpeak Plots on Web Pages

You can embed ThingSpeak™ graphics and display up-to-date data on your own website or blog. You can use ThingSpeak displays to:

  • Provide Real-time updates of your measured values on your own web page.

  • Create a dashboard for showing multiple fields or channels on the same page.

  • Make a mobile app with embedded ThingSpeak plots.

Embed a Plot in a Web Page

  1. Gather the <iframe> tag information from the plot you are interested in. On the title bar of your plot, click the word bubble.

  2. Copy the text that appears in the window. The text has the format shown here:

    <iframe width="450" height="260" style="border: 1px solid #cccccc;" src="">

  3. You can edit HTML in any plain text editor such as Notepad. In your editor, add the element you copied from your channel to your html file.

    <html><head><title>ThingSpeak Embedded Plot</title></head>
    <iframe width="450" height="260" style="border: 1px solid #cccccc;" src="">

Here is a sample of an embedded plot on a web page.

Resize Plots for ThingSpeak Dashboard

You can resize the iframe to make sure the plots fit the space available. Plot size is especially important for mobile displays. If you provide only the constraining parameter, your browser makes sure the object fits into the space defined. For example, use <iframe width=”200”...> to be sure your iframe fits within a 200 pixel space on the display.

You can also combine multiple plots from different channels of fields in the same display. Here is a dashboard view of four plots.

One has been manually resized to fit the space. The table space controls the size of three of the plots. This html code demonstrates a ThingSpeak dashboard.

<title>Data Collection Dashboard</title>
<table border=2 bordercolor="#0000FF">
<tr><td colspan="2">
<h1 align="center" color="#00FFFF">Data Collection Dashboard</h1>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src=""></iframe>
<td><iframe width="450" height="260" style="border: 1px solid #cccccc;" src=""></iframe>
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src=""></iframe>
<iframe width="300" style="border: 1px solid #cccccc;" src=""></iframe>
<a href="">Google</a><br>
<a href="">Mathworks</a><br>
<a href="">Wikipedia</a>

Related Topics