adjusted graph to be svg

This commit is contained in:
Nico Melone
2025-01-22 16:11:17 -06:00
parent 9645bb4170
commit 0c6098a011
7 changed files with 100 additions and 35 deletions

12
templates/base.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Report</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}" />
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

View File

@@ -1,29 +1,30 @@
<div id="graph"></div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
const data = {{ graph_data | safe }};
Plotly.newPlot('graph', data);
</script>
{% extends "base.html" %}
{% block content %}
<h1>Report</h1>
<img src="{{ graph_image }}" alt="{{ graph_image }}">
<table>
<thead>
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
{% for row in table_data %}
<tr>
<td>{{ row[0] }}</td>
<td>{{ row[1] }}</td>
</tr>
<tr>
<td>{{ row[0] }}</td>
<td>{{ row[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</tbody>
</table>
<form method="POST" action="/submit">
<label for="data">Enter Data:</label>
<input type="text" id="data" name="data">
<button type="submit">Submit</button>
</form>
<form method="POST" action="/submit">
<label for="data">Enter Data:</label>
<input type="text" id="data" name="data" />
<button type="submit">Submit</button>
</form>
{% endblock %}