<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content" th:object="${statisMap}">

        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h1>40,886,200</h1></span>
                        <h2>用户总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>40,886,200</h2></span>
                        <h2>会员总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>40,886,200</h2></span>
                        <h2>订单总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>40,886,200元</h2></span>
                        <h2>订单总金额</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>1,200</h2></span>
                        <h2>招标项目总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>4,000</h2></span>
                        <h2>中标项目总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <span class="pull-right"><h2>4000</h2></span>
                        <h2>悬赏总数</h2>
                    </div>
                    <div class="ibox-content">
                        <span class="pull-right"><h2>200<i class="glyphicon glyphicon-arrow-up text-navy"></i></h2></span>
                        <h2>昨日新增</h2>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>平台活跃用户数</h5>
<!--                        <div class="pull-right">-->
<!--                            <div class="btn-group">-->
<!--                                <button type="button" class="btn btn-xs btn-white active">天</button>-->
<!--                                <button type="button" class="btn btn-xs btn-white">月</button>-->
<!--                                <button type="button" class="btn btn-xs btn-white">年</button>-->
<!--                            </div>-->
<!--                        </div>-->
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="flot-chart">
                                    <div class="flot-chart-content" id="flot-dashboard-chart"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
    
    <th:block th:include="include :: sparkline-js" />
    <script type="text/javascript">
	    $(document).ready(function () {
	        var data3 = [
	            [gd(2012, 1, 1), 800], [gd(2012, 1, 2), 500], [gd(2012, 1, 3), 600], [gd(2012, 1, 4), 700],
	            [gd(2012, 1, 5), 500], [gd(2012, 1, 6), 456], [gd(2012, 1, 7), 800], [gd(2012, 1, 8), 589],
	            [gd(2012, 1, 9), 467], [gd(2012, 1, 10), 876], [gd(2012, 1, 11), 689], [gd(2012, 1, 12), 700],
	            [gd(2012, 1, 13), 500], [gd(2012, 1, 14), 600], [gd(2012, 1, 15), 700], [gd(2012, 1, 16), 786],
	            [gd(2012, 1, 17), 345], [gd(2012, 1, 18), 888]
	        ];
	
	
	        var dataset = [
	            {
	                label: "活跃数",
	                data: data3,
	                color: "#1ab394",
	                bars: {
	                    show: true,
	                    align: "center",
	                    barWidth: 24 * 60 * 60 * 600,
	                    lineWidth: 0
	                }
	
	            }
	        ];
	
	
	        var options = {
	            xaxis: {
	                mode: "time",
	                tickSize: [2, "day"],
	                tickLength: 0,
	                axisLabel: "Date",
	                axisLabelUseCanvas: true,
	                axisLabelFontSizePixels: 12,
	                axisLabelFontFamily: 'Arial',
	                axisLabelPadding: 20,
	                color: "#838383"
	            },
	            yaxes: [{
	                    position: "left",
	                    max: 1070,
	                    color: "#838383",
	                    axisLabelUseCanvas: true,
	                    axisLabelFontSizePixels: 12,
	                    axisLabelFontFamily: 'Arial',
	                    axisLabelPadding: 2
	            }, {
	                    position: "right",
	                    clolor: "#838383",
	                    axisLabelUseCanvas: true,
	                    axisLabelFontSizePixels: 12,
	                    axisLabelFontFamily: ' Arial',
	                    axisLabelPadding: 300
	            }
	            ],
	            legend: {
	                noColumns: 1,
	                labelBoxBorderColor: "#000000",
	                position: "nw"
	            },
	            grid: {
	                hoverable: false,
	                borderWidth: 0,
	                color: '#838383'
	            }
	        };
	
	        function gd(year, month, day) {
	            return new Date(year, month - 1, day).getTime();
	        }
	
	        var previousPoint = null,
	            previousLabel = null;
	
	        $.plot($("#flot-dashboard-chart"), dataset, options);

            for (let i = 1; i <= 8; i++) {
                var $lable = $("#flot-dashboard-chart > div.tickLabels > div.xAxis.x1Axis > div:nth-child(" + i + ")");
                let css = $lable.css("left");
                let splitElement = css.split("px")[0] - 34;
                console.log(css.split(",")[0]  + "原来："+ css +",现在"+ splitElement)
                $lable.css("left", splitElement + "px");
            }
	    });
    </script>
</body>
</html>
