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' %}
{% load static %}
{% block content%}
{% extends 'polls/base.html' %} {% load static %} {% block content%}
<div class="flex-container">
<div class="row">
<div class="col-xs-12">
<div id="chart1" style="width: 100%%;height:400px;margin:20px 10px;"></div>
</div>
<div class="col-xs-12">
<div id="chart2" style="width: 100%%;height:400px;margin:20px 10px;"></div>
</div>
<div class="row">
<div class="col-xs-12">
<div
id="chart1"
style="width: 100%%; height: 400px; margin: 20px 10px"
></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>
{% endblock%}
{% block add_js %}
{% endblock%} {% block add_js %}
<script src="{% static 'polls/js/echarts.min.js' %}"></script>
<script type="text/javascript">
var myChart = echarts.init(document.getElementById('chart1'));
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: [320, 332, 301, 334, 390]
},
{
name: '微博',
type: 'bar',
data: [220, 182, 191, 234, 290]
},
{
name: '头条',
type: 'bar',
data: [150, 232, 201, 154, 190]
},
{
name: '抖音',
type: 'bar',
data: [98, 77, 101, 99, 40]
},
{
name: '其他',
type: 'bar',
data: [25, 32, 46, 20, 8]
}
]
};
myChart.setOption(option);
var myChart = echarts.init(document.getElementById("chart1"));
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);
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: [320, 332, 301, 334, 390],
},
{
name: "微博",
type: "bar",
data: [220, 182, 191, 234, 290],
},
{
name: "头条",
type: "bar",
data: [150, 232, 201, 154, 190],
},
{
name: "抖音",
type: "bar",
data: [98, 77, 101, 99, 40],
},
{
name: "其他",
type: "bar",
data: [25, 32, 46, 20, 8],
},
],
};
myChart.setOption(option);
</script>
{% endblock %}
{% endblock %}