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 %}
|
|
|
|
<a href="/stats/product/{{stat.productID}}" class="product product-link">
|
|
|
|
<div class="product-title">{{stat.userID}}</div>
|
|
|
|
<div class="product-content-container">
|
|
|
|
<div class="product-details">
|
|
|
|
<div class="product-price">£{{stat.productID}}</div>
|
|
|
|
<div class="product-description hide-overflow ">{{stat.viewDate}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|