change media_statistics

This commit is contained in:
baoliang 2021-04-19 08:31:26 +08:00
parent 8ae4ede5cc
commit d4a333b9e3
2 changed files with 78 additions and 141 deletions

View File

@ -1,148 +1,85 @@
{% extends 'polls/base.html' %} {% extends 'polls/base.html' %} {% load static %} {% block content%}
{% load static %}
{% block content%}
<div class="flex-container"> <div class="flex-container">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div id="chart1" style="width: 100%%;height:400px;margin:20px 10px;"></div> <div
</div> id="chart1"
<div class="col-xs-12"> style="width: 100%%; height: 400px; margin: 20px 10px"
<div id="chart2" style="width: 100%%;height:400px;margin:20px 10px;"></div> ></div>
</div>
</div> </div>
<div class="col-xs-12">
<div id="chart2" style="width: 100%%; height: 400px; margin: 20px 10px">
<div style="text-indent: 2em;">统计数据更新日期2021.03.21</div>
<div style="text-indent: 2em;">本次监测政务新媒体账号5032个监测时段内发表文章累计123456篇。</div>
</div>
</div>
</div>
</div> </div>
{% endblock%} {% endblock%} {% block add_js %}
{% block add_js %}
<script src="{% static 'polls/js/echarts.min.js' %}"></script> <script src="{% static 'polls/js/echarts.min.js' %}"></script>
<script type="text/javascript"> <script type="text/javascript">
var myChart = echarts.init(document.getElementById('chart1')); var myChart = echarts.init(document.getElementById("chart1"));
var option = { var option = {
title: { title: {
text: '全省政务新媒体更新次数(逐月)', text: "全省政务新媒体更新次数(逐月)",
subtextStyle: { subtextStyle: {
fontSize: 16, fontSize: 16,
}, },
left: 'center' left: "center",
}, },
color: ['#003366', '#006699', '#4cabce', '#e5323e', '#ccc'], color: ["#003366", "#006699", "#4cabce", "#e5323e", "#ccc"],
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
axisPointer: { axisPointer: {
type: 'shadow' type: "shadow",
} },
}, },
legend: { legend: {
top: '10%', top: "10%",
data: ['微信', '微博', '头条', '抖音', '其它'] data: ["微信", "微博", "头条", "抖音", "其它"],
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: "category",
axisTick: {show: false}, axisTick: { show: false },
data: ['6月','7月', '8月', '9月', '10月'] data: ["6月", "7月", "8月", "9月", "10月"],
} },
], ],
yAxis: [ yAxis: [
{ {
type: 'value' type: "value",
} },
], ],
series: [ series: [
{ {
name: '微信', name: "微信",
type: 'bar', type: "bar",
barGap: 0, barGap: 0,
data: [320, 332, 301, 334, 390] data: [320, 332, 301, 334, 390],
}, },
{ {
name: '微博', name: "微博",
type: 'bar', type: "bar",
data: [220, 182, 191, 234, 290] data: [220, 182, 191, 234, 290],
}, },
{ {
name: '头条', name: "头条",
type: 'bar', type: "bar",
data: [150, 232, 201, 154, 190] data: [150, 232, 201, 154, 190],
}, },
{ {
name: '抖音', name: "抖音",
type: 'bar', type: "bar",
data: [98, 77, 101, 99, 40] data: [98, 77, 101, 99, 40],
}, },
{ {
name: '其他', name: "其他",
type: 'bar', type: "bar",
data: [25, 32, 46, 20, 8] data: [25, 32, 46, 20, 8],
} },
] ],
}; };
myChart.setOption(option); myChart.setOption(option);
var myChart2 = echarts.init(document.getElementById('chart2'));
var option = {
title: {
text: '全省政务新媒体开设数量(逐月)',
subtextStyle: {
fontSize: 16,
},
left: 'center'
},
color: ['#003366', '#006699', '#4cabce', '#e5323e', '#ccc'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
top: '10%',
data: ['微信', '微博', '头条', '抖音', '其它']
},
xAxis: [
{
type: 'category',
axisTick: {show: false},
data: ['6月','7月', '8月', '9月', '10月']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '微信',
type: 'bar',
barGap: 0,
data: [40, 80, 44, 36, 78]
},
{
name: '微博',
type: 'bar',
data: [25, 14, 41, 10, 18]
},
{
name: '头条',
type: 'bar',
data: [21, 32, 21, 14, 19]
},
{
name: '抖音',
type: 'bar',
data: [98, 77, 101, 99, 40]
},
{
name: '其他',
type: 'bar',
data: [25, 32, 46, 20, 8]
}
]
};
myChart2.setOption(option);
</script> </script>
{% endblock %} {% endblock %}