NexusDash-izebra/app/templates/reports/graph.html.j2

52 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-03-14 03:10:07 +00:00
{% extends 'base.html.j2' %}
{% block title %}
2022-03-14 18:07:50 +00:00
{{ name }} History for the Last 30 Days
2022-03-14 03:10:07 +00:00
{% endblock title %}
{% block content_before %}
2022-03-14 18:07:50 +00:00
{{ name }} History for the Last 30 Days
2022-03-14 03:10:07 +00:00
{% endblock content_before %}
{% block content %}
<canvas id="item_chart"></canvas>
{% endblock %}
{% block js %}
{{ super () }}
<script type="text/javascript" src="{{ url_for('static', filename='chartjs/chart.min.js') }}"></script>
<script>
$(document).ready(function(){
let config = {
type: 'line',
data: {
labels: {{labels}},
datasets: {{datasets}},
},
options: {
2022-03-14 18:07:50 +00:00
plugins: { legend: { display: false }, },
scales: {
x: {
title: {
display: true,
text: 'Date'
},
display: true
},
y: {
display: true,
type: 'logarithmic',
text: '{{ name }}'
}
}
2022-03-14 03:10:07 +00:00
}
};
let items_chart = new Chart(
document.getElementById('item_chart'),
config
);
}
);
</script>
{% endblock %}