48 lines
1.3 KiB
HTML
48 lines
1.3 KiB
HTML
<link rel="stylesheet" href="{{ url_for('static', filename='css/products.css') }}">
|
|
|
|
|
|
<div>
|
|
<canvas id="myChart"></canvas>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
|
|
<script>
|
|
const ctx = document.getElementById('myChart');
|
|
|
|
new Chart(ctx, {
|
|
type: 'bar',
|
|
data: {
|
|
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
|
|
datasets: [{
|
|
label: '# of Votes',
|
|
data: [12, 19, 3, 5, 2, 3],
|
|
borderWidth: 1
|
|
}]
|
|
},
|
|
options: {
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<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>
|