<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../../../common/admin/head.jsp"></jsp:include>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>/resource/css/admin/home/index.css">
</head>
<body>
<jsp:include page="../../../common/admin/body_pre.jsp"></jsp:include>
<div class="row hidden-print">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h2>公众评价</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:void(0);">城市发展</a>
                    </li>
                    <li class="active">
                        <strong>公众评价</strong>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>
<div class="row hidden-print">
    <div class="col-lg-3 col-md-3">
        <div class="ibox shortcut">
            <div class="ibox-title-noline">
                <span>积极舆情</span>
            </div>
            <div class="ibox-content-noline">
                <div id="divChart1" style="width: 100%;height: 400px;"></div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-3">
        <div class="ibox shortcut">
            <div class="ibox-title-noline">
                <span>消极舆情</span>
            </div>
            <div class="ibox-content-noline">
                <div id="divChart2" style="width: 100%;height: 400px;">
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-3">
        <div class="ibox shortcut">
            <div class="ibox-title-noline">
                <span>综合生活条件</span>
            </div>
            <div class="ibox-content-noline">
                <div id="divChart3" style="width: 100%;height: 400px;">
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-3">
        <div class="ibox shortcut">
            <div class="ibox-title-noline">
                <span>政府执政能力</span>
            </div>
            <div class="ibox-content-noline">
                <div id="divChart4" style="width: 100%;height: 400px;">
                </div>
            </div>
        </div>
    </div>
</div>
<%--<div class="row hidden-print">--%>
    <%--<div class="col-lg-12 col-md-3">--%>
        <%--<div class="ibox shortcut">--%>
            <%--<div class="ibox-title-noline">--%>
                <%--<span>其他通过调研问卷总计的舆情信息</span>--%>
            <%--</div>--%>
            <%--<div class="ibox-content-noline">--%>
                <%--<div id="divChart5" style="width: 100%;height: 400px;"></div>--%>
            <%--</div>--%>
        <%--</div>--%>
    <%--</div>--%>
<%--</div>--%>


<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript" src="<%=basePath%>/resource/plugins/echarts/echarts-wordcloud.min.js"></script>
<script type="text/javascript">
    var myChart1 = echarts.init(document.getElementById('divChart1'));
    var myChart2 = echarts.init(document.getElementById('divChart2'));
    var myChart3 = echarts.init(document.getElementById('divChart3'));
    var myChart4 = echarts.init(document.getElementById('divChart4'));
   // var myChart5 = echarts.init(document.getElementById('divChart5'));
    option5 = {};

    var renderFunc = function () {
        $.get('<%=basePath%>/admin/publish/getComprehensive.action').done(function (data) {
            option3 = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                legend: {
                    data: ['不满意', '一般','满意','非常满意']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis:  {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: data.name
                },
                series: [
                    {
                        name: '不满意',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        data: data.siG
                    },
                    {
                        name: '一般',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        data: data.wifi
                    },
                    {
                        name: '满意',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        data: data.television
                    },
                    {
                        name: '非常满意',
                        type: 'bar',
                        stack: '总量',
                        label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
                        data: data.reads
                    }
                ]
            };
            myChart3.setOption(option3, true);
            option4 = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                        type : 'shadow'         // 默认为直线，可选为：'line' | 'shadow'
                    }
                },
                legend: {
                    data:['不满意','一般','满意','非常满意']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis : [
                    {
                        type : 'category',
                        data :  data.name1
                    }
                ],
                yAxis : [
                    {
                        type : 'value'
                    }
                ],
                series : [
                    {
                        name:'不满意',
                        type:'bar',
                        barWidth : 5,
                        stack: '搜索引擎',
                        data:data.value1
                    },
                    {
                        name:'一般',
                        type:'bar',
                        stack: '搜索引擎',
                        data:data.value
                    },
                    {
                        name:'满意',
                        type:'bar',
                        stack: '搜索引擎',
                        data:data.value2
                    },
                    {
                        name:'非常满意',
                        type:'bar',
                        stack: '搜索引擎',
                        data:data.value3
                    }
                ]
            };
            myChart4.setOption(option4, true);
        })
        $.get('<%=basePath%>/admin/publish/getPublicSentiment.action').done(function (data) {
            option1 = {

                tooltip: {
                    show: true
                },
                series: [{
                    type : 'wordCloud',  //类型为字符云
                    shape:'smooth',  //平滑
                    gridSize : 2, //网格尺寸
                    size : ['100%','100%'],
                    rotationRange : [ 46, 80 ], //旋转范围
                    textStyle : {
                        normal : {
                            fontFamily:'sans-serif',
                            color : function() {
                                return 'rgb('
                                    + [ Math.round(Math.random() * 160),
                                        Math.round(Math.random() * 160),
                                        Math.round(Math.random() * 160) ]
                                        .join(',') + ')';
                            }
                        },
                        emphasis : {
                            shadowBlur : 5,  //阴影距离
                            shadowColor : '#333'  //阴影颜色
                        }
                    },

                    data: data.value
                    // [
                    //     {
                    //         name: data.value[0].name
                    //
                    //     },
                    //     {
                    //         name: data.value[1].name
                    //
                    //
                    //     },
                    //     {
                    //         name: data.value[2].name
                    //
                    //
                    //     },
                    //     {
                    //         name:data.value[3].name
                    //
                    //
                    //     },
                    //     {
                    //         name:data.value[4].name
                    //
                    //
                    //     }
                    // ]
                }]
            }
            myChart1.setOption(option1, true);
        })
        $.get('<%=basePath%>/admin/publish/getPublicSentiment1.action').done(function (data) {
            option2={

                tooltip: {
                    show: true
                },
                series: [{
                    type : 'wordCloud',  //类型为字符云
                    shape:'smooth',  //平滑
                    gridSize : 1, //网格尺寸
                    size : ['100%','100%'],
                    //sizeRange : [ 50, 100 ],
                    rotationRange : [ 46, 80 ], //旋转范围
                    textStyle : {
                        normal : {
                            fontFamily:'sans-serif',
                            color : function() {
                                return 'rgb('
                                    + [ Math.round(Math.random() * 160),
                                        Math.round(Math.random() * 160),
                                        Math.round(Math.random() * 160) ]
                                        .join(',') + ')';
                            }
                        },
                        emphasis : {
                            shadowBlur : 1,  //阴影距离
                            shadowColor : '#333'  //阴影颜色
                        }
                    },

                    data: data.value
                    //     [
                    //     {
                    //         name: "Sam S Club",
                    //         value: 10000,
                    //         itemStyle: {
                    //             normal: {
                    //                 color: 'black'
                    //             }
                    //         }
                    //     },
                    //     {
                    //         name: "Macys"
                    //
                    //
                    //     },
                    //     {
                    //         name: "Amy Schumer"
                    //
                    //
                    //     },
                    //     {
                    //         name: "Jurassic World"
                    //
                    //
                    //     },
                    //     {
                    //         name: "Point Break"
                    //
                    //
                    //     }
                    // ]
                }]
            }
            myChart2.setOption(option2, true);
        });
        myChart5.setOption(option5, true);
    };
    renderFunc();
    /*setInterval(renderFunc, 3000);*/
</script>
</body>
</html>