nophead / EnviroPlusWeb

Web interface for Enviro+ sensor board plugged into a Raspberry PI
GNU General Public License v3.0
39 stars 20 forks source link

Feature Request - Separate graphs #11

Open prutsky opened 3 years ago

prutsky commented 3 years ago

Hi nophead, A very nice webpage you created for the Enviroplus. All running on the Pi itself.

I run you code for a year now, but like to be able to view the values in separate graphs. Have been editing your code, but fail to succeed. For instance when I want to remove the fan part:

<!--
<tr><td><label` for="fan">Fan:</label></td>
                <td><input id="fan" type="number" min="0" max="100" step="5" value="100" size="3" name="fan"></td>
                        </tr>
-->

) The graph and legend isn't showing anymore?!

But the hardest part is still to come. setting every value in a separate tab / graph with the appropriate scale. Testing this by repeating the:

<td><canvas id="canvas" height="480" width="640"></canvas><br><br>
        <table><tr id = "legend"></tr><tr id = "range"></tr></table>
    </td>

part isn't doing the trick.

As you can see, my javascript/HTML isn't that good. Can you maybe give me some tips?

nophead commented 3 years ago

Removing the fan code probably fails because the javascript uses the "fan" label to find the fan setting and sends it in the page request url. You would have to change the Javascript to not reference the label.

I have no idea how to do tabbed pages in HTML / javascript. A quick Google finds this: https://www.w3schools.com/howto/howto_js_full_page_tabs.asp