Commit 20a654b9 authored by Kristian Tan's avatar Kristian Tan

Put graph in smart meter box

parent 3736be77
...@@ -54,3 +54,8 @@ body { ...@@ -54,3 +54,8 @@ body {
.smart_meter_info { .smart_meter_info {
margin-left: 5%; margin-left: 5%;
} }
.chart {
width: 600px;
height: 400px;
}
\ No newline at end of file
...@@ -46,30 +46,9 @@ ...@@ -46,30 +46,9 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</div>
</div>
</div>
<div class="inputs">
{% if display_change_kWh == True %}
<form action="{{ url_for('handle_change_kWh') }}" method="post">
Change cost per kWh: <input type="text" name="kWhprice" required>
<input type="submit">
</form>
{% endif %}
{% if display_new_device_form == True %}
<div class=".add_new_device_form">
<form action="{{ url_for('handle_new_device') }}" method="post">
New device name: <input type="text" name="new_device_name" required> <br>
New device wattage: <input type="number" name="new_device_wattage" required> <br>
<input type="submit">
</form>
</div>
{% endif %}
</div>
<canvas id="chart" width="600" height="400"></canvas> {# <div class="chart">#}
<canvas class="chart" ></canvas>
<script> <script>
// bar chart data // bar chart data
var barData = { var barData = {
...@@ -108,5 +87,28 @@ ...@@ -108,5 +87,28 @@
); );
</script> </script>
{# </div>#}
</div>
</div>
</div>
<div class="inputs">
{% if display_change_kWh == True %}
<form action="{{ url_for('handle_change_kWh') }}" method="post">
Change cost per kWh: <input type="text" name="kWhprice" required>
<input type="submit">
</form>
{% endif %}
{% if display_new_device_form == True %}
<div class=".add_new_device_form">
<form action="{{ url_for('handle_new_device') }}" method="post">
New device name: <input type="text" name="new_device_name" required> <br>
New device wattage: <input type="number" name="new_device_wattage" required> <br>
<input type="submit">
</form>
</div>
{% endif %}
</div>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment