2024-02-02 16:42:19 +00:00
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/products.css') }}">
|
2024-02-02 17:43:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
<div>
|
2024-02-06 19:15:44 +00:00
|
|
|
<canvas id="myChart" width="800px" height="500px"></canvas>
|
2024-02-02 17:43:03 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
const ctx = document.getElementById('myChart');
|
|
|
|
|
|
|
|
new Chart(ctx, {
|
2024-02-02 21:01:29 +00:00
|
|
|
type: 'line',
|
2024-02-02 17:43:03 +00:00
|
|
|
data: {
|
2024-02-06 19:15:44 +00:00
|
|
|
labels: {{headings}},
|
2024-02-02 21:01:29 +00:00
|
|
|
datasets: [{
|
2024-02-06 19:15:44 +00:00
|
|
|
label: '# of Views',
|
2024-02-02 21:01:29 +00:00
|
|
|
data: {{data}},
|
|
|
|
borderWidth: 1
|
|
|
|
}]
|
2024-02-02 17:43:03 +00:00
|
|
|
},
|
|
|
|
options: {
|
2024-02-02 21:01:29 +00:00
|
|
|
scales: {
|
|
|
|
y: {
|
2024-02-06 19:15:44 +00:00
|
|
|
title: {
|
|
|
|
display: true,
|
|
|
|
text: "Num Views"
|
|
|
|
},
|
2024-02-02 21:01:29 +00:00
|
|
|
beginAtZero: true
|
2024-02-06 19:15:44 +00:00
|
|
|
},
|
|
|
|
x: {
|
|
|
|
title: {
|
|
|
|
display: true,
|
|
|
|
text: "Prev Days"
|
|
|
|
},
|
2024-02-02 21:01:29 +00:00
|
|
|
}
|
2024-02-02 17:43:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2024-02-02 16:42:19 +00:00
|
|
|
|
|
|
|
<div class="product-container">
|
|
|
|
{% if data != None %}
|
|
|
|
{% for stat in data %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|