April 18, 2011
Working with engineers and non-engineers I have to convert between metric and standard (US units) a lot. I adopted as a general rule that I store all my data in metric - so I send my data to ThingSpeak in metric. But this is not necessary how I want to display them. I was wondering if you could have two float values with each chart - a scale and an offset. The display value would be scale * database_value + offset. If I do not want to use it, than the default values should be scale = 1 and offset = 0. For converting deg C to deg F I set scale to 1.8 and offset to 32. For % I set scale to 100 and offset to 0. I would need this for each chart (so I would like to pass this as an argument when I create the chart (just like timescale=10). SO I could actually show deg C and deg F on the same page!
March 14, 2011
Here's how you would do it, using the code from our homepage as an example:
The first step is copying both <script> tags completely into your page. You'll also want to add the container for the chart:
<div id="chart-container" style="width: 500px; height: 260px; padding-left: 20px; float: left;"></div>
Then use your channel's id (instead of 9) in the line that begins with:
Looking at the line that says:
This needs to be changed to:
That should do it for you, if you need more help tell me your channel id and I'll write the complete example for you.
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormier
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457