updata code

This commit is contained in:
2024-05-30 20:08:14 +08:00
parent 9c62923cb3
commit 1c9972c389
2 changed files with 72 additions and 233 deletions
+67 -231
View File
@@ -621,6 +621,7 @@
<div id="main" style="width: 1000px;height:500px;"></div>
<div id="app2" style="width: 1000px;height:500px;"></div>
<div id="app3" style="width: 1300px;height:500px;"></div>
<div id="app4" style="width: 1300px;height:500px;"></div>
</main>
<!-- 右侧内容 start-->
@@ -635,96 +636,33 @@
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
option = {
color: ['#67F9D8', '#FFE434', '#56A3F1', '#FF917C'],
option = {
title: {
text: '{{ name }}雷达贡献图'
text: '{{ name }}社会情感投入雷达图'
},
legend: {
data: [ {% for stu in student %}
"{{ stu }}",
{% endfor %}]
},
radar: {
// shape: 'circle',
indicator: [
{ name: '积极', max: 200 },
{ name: '消极', max: 200 },
{ name: '中立', max: 200 },
]
},
legend: {},
radar: [
{
indicator: [
{text: '协作参与度'},
{text: '问答活跃度'},
{text: '内容贡献度'},
{text: '小组配合度'},
{text: '机器人使用'}
],
center: ['25%', '50%'],
radius: 120,
startAngle: 90,
splitNumber: 4,
shape: 'circle',
axisName: {
formatter: '【{value}】',
color: '#428BD4'
},
splitArea: {
areaStyle: {
color: ['#77EADF', '#26C3BE', '#64AFE9', '#428BD4'],
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 10
}
},
axisLine: {
lineStyle: {
color: 'rgba(211, 253, 250, 0.8)'
}
},
splitLine: {
lineStyle: {
color: 'rgba(211, 253, 250, 0.8)'
}
}
},
{
indicator: [
{text: '协作参与度', max:200},
{text: '问答活跃度', max:200},
{text: '内容贡献度', max:200},
{text: '小组配合度', max:200},
{text: '机器人使用', max:200}
],
center: ['75%', '50%'],
radius: 120,
axisName: {
color: '#fff',
backgroundColor: '#666',
borderRadius: 3,
padding: [3, 5]
}
}
],
series: [
{
name: 'Budget vs spending',
type: 'radar',
emphasis: {
lineStyle: {
width: 4
}
},
data: [
{% for stu,data in datas %}
{% if forloop.counter|divisibleby:2 %}
{
value: {{ data }},
name: '{{ stu }}',
},
{% endif %}
{% endfor %}
]
},
{
type: 'radar',
radarIndex: 1,
data: [
{% for stu,data in datas2 %}
{% if forloop.counter|divisibleby:2 == 0 %}
{
value: {{ data }},
name: '{{ stu }}',
},
{% endif %}
{
value:{{ data }},
name:'{{ stu }}'
},
{% endfor %}
]
}
@@ -804,13 +742,14 @@
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('app3'));
option = {
title: {
text: '{{ name }}贡献活跃度'
text: '{{ name }}行为投入参与度'
},
tooltip: {
trigger: 'axis',
@@ -841,7 +780,7 @@
],
series: [
{
name: '发言热度',
name: '写作字数',
type: 'bar',
emphasis: {
focus: 'series'
@@ -851,7 +790,7 @@
{% endfor %}]
},
{
name: '活跃热度',
name: '发言条数',
type: 'bar',
stack: 'Ad',
emphasis: {
@@ -860,89 +799,6 @@
data: [{% for stu in sui2 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '贡献热度',
type: 'bar',
stack: 'Ad',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui3 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '评价热度',
type: 'bar',
stack: 'Ad',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui4 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '交流热度',
type: 'bar',
data: [{% for stu in sui5 %}
'{{ stu }}',
{% endfor %}],
emphasis: {
focus: 'series'
},
markLine: {
lineStyle: {
type: 'dashed'
},
data: [[{ type: 'min' }, { type: 'max' }]]
}
},
{
name: '讨论热度',
type: 'bar',
barWidth: 5,
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui6 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '情感热度',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui7 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '交互热度',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui8 %}
'{{ stu }}',
{% endfor %}]
},
{
name: '其他',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [{% for stu in sui9 %}
'{{ stu }}',
{% endfor %}]
}
]
};
@@ -954,68 +810,48 @@
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('app4'));
option = {
title: {
text: 'Stacked Line'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
option = {
title: {
text: '{{name}}行为投入专注度'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: [{% for stu in student %}
"{{ stu }}",
{% endfor %}]
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['2024-05/26', '2024-05/27', '2024-05/28', '2024-05/29', '2024-05/30']
},
yAxis: {
type: 'value'
},
series: [
{% for stu,data in datas4 %}
{
name: '{{ stu }}',
type: 'line',
stack: 'Total',
data: {{ data }},
},
{% endfor %}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);