tartiflette/app/templates/applist_history.html

93 lines
2.7 KiB
HTML
Raw Normal View History

2018-05-23 00:02:02 +02:00
{% extends "base.html" %}
{% block content %}
<div id="levelHistory" style="height: 270px;" class="col-sm-8 offset-sm-2 my-3"></div>
<div id="stateHistory" style="height: 270px;" class="col-sm-8 offset-sm-2 my-3"></div>
<script src="{{ url_for('static', filename='js/canvasjs.min.js') }}"></script>
<script>
window.onload = function () {
var colors_per_level = [
"#d9534f",
"#E26D4F",
"#E98D4E",
"#f0ad4e",
"#CBB052",
"#A6B255",
"#7AB659",
2019-04-29 22:29:08 +02:00
"#5cb85c",
2020-12-30 23:34:48 +01:00
"#4695d5",
"#8960b3"
2018-05-23 00:02:02 +02:00
];
var colors_per_state = {
official: "#0000ff",
working: "#5cb85c",
inprogress: "#f0ad4e",
notworking: "#d9534f"
};
var chart = new CanvasJS.Chart("levelHistory", {
animationEnabled: false,
title:{
2020-09-03 19:33:59 +02:00
text: "Apps quality level (from automatic tests)"
2018-05-23 00:02:02 +02:00
},
toolTip: {
reversed: true,
shared: true
},
data: [
2020-12-30 23:34:48 +01:00
{% for level in range(9,-1,-1) %}
2018-05-23 00:02:02 +02:00
{
color: colors_per_level[{{ level }}],
type: "stackedArea",
showInLegend: true,
toolTipContent: "<span style=\"color:"+colors_per_level[{{ level }}]+"\"><strong>Level {{ level }}: </strong></span> {y}{% if loop.first %}<br><b>Total:<b> #total{% endif %}",
name: "Level {{ level }}",
dataPoints: [
{% for d in data %}
{ label: "{{ d.date }}", y: {{ d["level-"+level|string] }} },
{% endfor %}
]
},
{% endfor %}
]
});
chart.render();
var chart2 = new CanvasJS.Chart("stateHistory", {
animationEnabled: false,
title:{
2020-09-03 19:33:59 +02:00
text: "Apps state (declared by packager)"
2018-05-23 00:02:02 +02:00
},
toolTip: {
reversed: true,
shared: true
},
data: [
{% for state in ["official", "working", "inprogress", "notworking"] %}
{
color: colors_per_state.{{ state }},
type: "stackedArea",
showInLegend: true,
toolTipContent: "<span style=\"color:"+colors_per_state.{{ state }}+"\"><strong>{{ state.title() }}: </strong></span> {y}{% if loop.first %}<br><b>Total:<b> #total{% endif %}",
name: "{{ state.title() }}",
dataPoints: [
{% for d in data %}
{ label: "{{ d.date }}", y: {{ d[state] }} },
{% endfor %}
]
},
{% endfor %}
]
});
chart2.render();
}
</script>
{% endblock %}