Files
2024-06-05 11:36:16 +08:00

109 lines
2.5 KiB
HTML

{% load static %}
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>成绩统计</title>
<link rel="stylesheet" href="{% static 'js/bootstrap-5.3.0/css/bootstrap.css' %}">
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/echarts.min.js' %}"></script>
</head>
<style>
.navbar {
justify-content: space-between;
border-radius: 0;
}
</style>
<body>
<div class="card container" style="width: 100%;">
<div class="card-body">
<div style="width: 50%; float: left; overflow: hidden">
<h1>各分段人数分布</h1>
<div id="x" class="center-block" style="height: 500px;width: 100%;display: inline-block;">
</div>
</div>
<div style="width: 50%; float: left; overflow: hidden">
<h1>错题人数分布</h1>
<div id="a" style="height: 500px;width: 100%;display: inline-block;">
</div>
</div>
</div>
</div>
</body>
<script>
const chartDom = document.getElementById('x');
const myChart = echarts.init(chartDom);
let option;
option = {
xAxis: {
type: 'category',
data: [
'0-10',
'11-20',
'21-30',
'31-40',
'41-50',
'51-60',
'60-70',
'70-80',
'80-90',
'90-100'
],
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
}
},
yAxis: {
type: 'value'
},
series: [
{
data: {{ scores|safe }},
type: 'bar'
}
]
};
option && myChart.setOption(option);
const dom = document.getElementById('a');
const c = echarts.init(dom);
let op;
op = {
xAxis: {
type: 'category',
data: {{ all_type|safe }},
axisLabel: {
//x轴文字的配置
show: true,
interval: 0,//使x轴文字显示全
}
},
yAxis: {
type: 'value'
},
series: [
{
data: {{ number|safe }},
type: 'bar'
}
]
};
op && c.setOption(op);
$('#logout').click(function () {
location.href = '/logout'
})
</script>
</html>