commentChar.html 14.7 KB
{% extends 'base_page.html' %}

{% block title %}
    <span data-i18n="commentChar">评论分析</span>
{% endblock %}
{% block  nav %}
<nav class="iq-sidebar-menu">
                  <ul id="iq-sidebar-toggle" class="side-menu">
                      <li class="px-3 pt-3 pb-2 ">
                          <span class="text-uppercase small font-weight-bold" data-i18n="home">首页</span>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/home" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
                                  </svg>
                              </i>
                              <span class="ml-2" data-i18n="home">首页</span>
                          </a>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/hotWord" class="svg-icon ">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
                                  </svg>
                              </i>
                              <span class="ml-2" data-i18n="hotWord">热词统计</span>
                          </a>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/tableData" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
                                  </svg>
                              </i>
                              <span class="ml-2" data-i18n="tableData">微博舆情统计</span>
                          </a>
                      </li>
                      <li class="px-3 pt-3 pb-2 ">
                          <span class="text-uppercase small font-weight-bold" data-i18n="dataVisualization">数据可视化</span>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/articleChar" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
                                  </svg>
                              </i>
                              <span class="ml-2" data-i18n="articleChar">文章分析</span>
                          </a>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/ipChar" class="svg-icon">
                              <i class="">
                                  <svg class="icon line" width="18" id="receipt" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" stroke="currentColor">
                                      <path d="M17,16V3L13,5,10,3,7,5,3,3V17.83A3.13,3.13,0,0,0,5.84,21,3,3,0,0,0,9,18V17a1,1,0,0,1,1-1H20a1,1,0,0,1,1,1v1a3,3,0,0,1-3,3H6" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path>
                                      <line x1="8" y1="10" x2="12" y2="10" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></line>
                                  </svg>
                              </i>
                              <span class="ml-2">IP分析</span>
                          </a>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/commentChar" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path>
                                  </svg>
                              </i><span class="ml-2">评论分析</span>
                          </a>
                      </li>
                      <li class="active sidebar-layout">
                          <a href="/page/yuqingChar" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                  </svg>
                              </i>
                              <span class="ml-2">舆情分析</span>
                          </a>
                      </li>
                      <li class="active sidebar-layout">
                          <a href="/page/yuqingpredict" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                  </svg>
                              </i>
                              <span class="ml-2">舆情预测</span>
                          </a>
                      </li>
                      <li class="px-3 pt-3 pb-2">
                          <span class="text-uppercase small font-weight-bold">词云图</span>
                      </li>
                      <li class=" sidebar-layout">
                          <a href="/page/articleCloud" class="svg-icon">
                              <i class="">
                                  <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
                                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
                                  </svg>
                              </i><span class="ml-2" data-i18n="articleCloud">文章内容词云图</span>
                          </a>
                      </li>
                  </ul>
              </nav>
{% endblock %}
{% block content %}
          <div class="container-fluid">
                <div class="row">
                      <div class="col-md-12 mb-4 mt-1">
                         <div class="d-flex flex-wrap justify-content-between align-items-center">
                             <h4 class="font-weight-bold" data-i18n="commentChar">评论分析</h4>
                         </div>
                      </div>
                   </div>
                <div class="row">
                    <div class="col-lg-12">
                         <div class="card card-block">
                            <div class="card-header d-flex justify-content-between pb-0">
                               <div class="header-title">
                                  <h4 class="card-title mb-0" data-i18n="commentLikeRangeChart">评论点赞次数区间图</h4>
                               </div>
                            </div>
                            <div class="card-body">
                               <div id="main" style="width: 100%;height: 450px"></div>
                            </div>
                         </div>
                      </div>
                    <div class="col-lg-6">
                         <div class="card card-block">
                            <div class="card-header d-flex justify-content-between pb-0">
                               <div class="header-title">
                                  <h4 class="card-title mb-0" data-i18n="commentUserGenderRatio">评论用户性别占比</h4>
                               </div>
                            </div>
                            <div class="card-body">
                               <div id="mainTwo" style="width: 100%;height: 450px"></div>
                            </div>
                         </div>
                      </div>
                    <div class="col-lg-6">
                         <div class="card card-block">
                            <div class="card-header d-flex justify-content-between pb-0">
                               <div class="header-title">
                                  <h4 class="card-title mb-0" data-i18n="userCommentWordCloud">用户评论词云图</h4>
                               </div>
                            </div>
                            <div class="card-body">
                               <div id="mainThree" style="width: 100%;height: 450px;text-align: center">
                                   <img style="width:84%" src="/static/commentCloud.jpg" alt="">
                               </div>
                            </div>
                         </div>
                      </div>
                </div>
          </div>

{% endblock %}

{% block echarts %}
    <script>
        var chartDom = document.getElementById('main');
        var myChart = echarts.init(chartDom);
        var option;

        option = {
              title: {
                text: '评论点赞量区间折线图',
                left: '1%'
              },
              tooltip: {
                trigger: 'axis'
              },
              grid: {
                left: '5%',
                right: '15%',
                bottom: '10%'
              },
            legend:{},
              xAxis: {
                data: {{ xData | tojson }}
              },
              yAxis: {},
              toolbox: {
                right: 10,
                feature: {
                  dataZoom: {
                    yAxisIndex: 'none'
                  },
                  restore: {},
                  saveAsImage: {}
                }
              },
              dataZoom: [
                {
                  show: true,
                  start: 80,
                  end: 100
                },
                {
                  type: 'inside',
                  start: 80,
                  end: 100
                }
              ],
              visualMap: {
                top: 50,
                right: 10,
                pieces: [
                  {
                    gt: 0,
                    lte: 50,
                    color: '#93CE07'
                  },
                  {
                    gt: 50,
                    lte: 100,
                    color: '#FBDB0F'
                  },
                  {
                    gt: 100,
                    lte: 150,
                    color: '#FC7D02'
                  },
                  {
                    gt: 150,
                    lte: 200,
                    color: '#FD0100'
                  },
                  {
                    gt: 200,
                    lte: 300,
                    color: '#AA069F'
                  },
                  {
                    gt: 300,
                    color: '#AC3B2A'
                  }
                ],
                outOfRange: {
                  color: '#999'
                }
              },
              series: {
                name: '点赞个数',
                type: 'line',
                data: {{ yData }},
                markLine: {
                  silent: true,
                  lineStyle: {
                    color: '#333'
                  },
                  data: [
                    {
                      yAxis: 50
                    },
                    {
                      yAxis: 100
                    },
                    {
                      yAxis: 150
                    },
                    {
                      yAxis: 200
                    },
                    {
                      yAxis: 300
                    }
                  ]
                }
              }
            }

        option && myChart.setOption(option);

    </script>
    <script>
        var chartDom = document.getElementById('mainTwo');
        var myChart = echarts.init(chartDom);
        var option;

        option = {
          title: {
            text: '评论性别占比饼图',
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          legend: {
            orient: 'vertical',
            left: 'left'
          },
          series: [
            {
              name: '性别个数',
              type: 'pie',
              radius: '50%',
              data: {{ genderPieData | tojson }},
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        };

        option && myChart.setOption(option);

    </script>
{% endblock %}