<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ 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>
    <script type="text/javascript" src="<%=basePath%>/resource/plugins/echarts/echarts.min.js"></script>
</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 class="active">--%>
                        <%--<strong>订单趋势分析</strong>--%>
                    <%--</li>--%>
                <%--</ol>--%>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../../../common/admin/search_pre.jsp"></jsp:include>
<form id="formSearch" action="<%=basePath%>/admin/userpersonal_mgr/list.action" method="get" class="form-inline">
    <div class="form-group">
        <label for="year">年份</label>
        <input type="text" id="year" name="year" class="form-control" />
    </div>
    <div class="form-group">
        <label for="month">月份</label>
        <input type="text" id="month" name="month" class="form-control" />
    </div>
    <div class="form-group">
        <button id="btnSearch" type="button" class="btn btn-sm btn-primary"><i class="fa fa-search"></i>查询</button>
    </div>
    <div class="form-group">
        <button id="btnReset" type="button" class="btn btn-sm btn-primary"><i class="fa fa-search"></i>重置</button>
    </div>
</form>
<jsp:include page="../../../common/admin/search_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/grid_pre.jsp"></jsp:include>
<jsp:include page="../../../common/admin/grid_middle.jsp"></jsp:include>
<div id="graphId" style="width: 1200px;height:400px;"></div>
<jsp:include page="../../../common/admin/grid_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('graphId'));
    function fnRegisterUserGraph(){
        var year=$('#year').val() ;
        var month=$('#month').val() ;
        $.post('<%=basePath%>/admin/orderTrade/list.action',{year:year,month:month},function(result){
            var data=result.data;
            myChart.setOption({
                // title: {
                //     text: data.year+'年注册用户分析图',
                //     subtext: '单位：个',
                // },
                tooltip: {
                    trigger: 'axis'
                },
                xAxis: {
                    type: 'category',
                    data: data.names
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    data: data.counts,
                    type: 'line',
                    smooth: true
                }]
            });
        })
    }
    fnRegisterUserGraph( );
    $('#btnSearch').click(fnRegisterUserGraph);
    $('#btnReset').click(function(){
        $('#formSearch')[0].reset();
    });
</script>
</body>
</html>