<%= render 'docs/sidebar' %>

Charts

The Charts API allows you to create an instant visualization of your data. The chart displays properly in all modern browsers and mobile devices. The chart can also show dynamic data by loading new data automatically.

Use the Charts API to present numerical data stored in ThingSpeak Channels on charts. Supported chart types are line, bar, column, and step. Options include size, color, and labels.


Creating a Chart

To create a chart, open the following URL, replacing CHANNEL_ID and FIELD_ID with values from one of your Channels.

http://api.thingspeak.com/channels/CHANNEL_ID/charts/FIELD_ID

Valid chart parameters:
Valid feed parameters:
Please note that the results parameter is not compatible with timescale, sum, average, or median.



Embedding a Chart

To place a ThingSpeak Chart on your webpage, use the Chart API as the source of an iframe.

Chart Embed Code:

<iframe width="450" height="250" style="border: 1px solid #cccccc;" src="http://thingspeak.com/channels/CHANNEL_ID/charts/FIELD_ID"></iframe>


Example Chart:

Embedding a Dynamic Chart

To place a dynamic ThingSpeak Chart on your webpage, use the Chart API as the source of an iframe and add the chart parameter ”dynamic=true”.

Chart Embed Code:

<iframe width="450" height="250" style="border: 1px solid #cccccc;" src="http://thingspeak.com/channels/CHANNEL_ID/charts/FIELD_ID?dynamic=true"></iframe>


Example Chart: