<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>流水线管理页</title>
    <!-- Favicon-->
    <link rel="icon" href="favicon.ico" type="image/x-icon">

    <!-- Google Fonts -->
    <link href="css/cyllic.css" rel="stylesheet" type="text/css">
    <link href="css/mateial.css" rel="stylesheet" type="text/css">

    <!-- Bootstrap Core Css -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css"
          integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <!-- Waves Effect Css -->
    <link href="plugins/node-waves/waves.css" rel="stylesheet"/>

    <!-- Animation Css -->
    <link href="plugins/animate-css/animate.css" rel="stylesheet"/>

    <!-- Morris Chart Css-->
    <link href="plugins/morrisjs/morris.css" rel="stylesheet"/>

    <!-- Custom Css -->
    <link href="css/style.css" rel="stylesheet">

    <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
    <link href="css/themes/all-themes.css" rel="stylesheet"/>

    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js"
            integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
            crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js"
            integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
            crossorigin="anonymous"></script>

    <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        /* css 代码  */
    </style>
    <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
    <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
    <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
    <script src="https://img.hcharts.cn/highcharts/themes/dark-unica.js"></script>
    <script language="JavaScript">
        function startTime()
        {
            var today=new Date();//定义日期对象
            var yyyy = today.getFullYear();//通过日期对象的getFullYear()方法返回年
            var MM = today.getMonth()+1;//通过日期对象的getMonth()方法返回年
            var dd = today.getDate();//通过日期对象的getDate()方法返回年
            var hh=today.getHours();//通过日期对象的getHours方法返回小时
            var mm=today.getMinutes();//通过日期对象的getMinutes方法返回分钟
            var ss=today.getSeconds();//通过日期对象的getSeconds方法返回秒
            // 如果分钟或小时的值小于10,则在其值前加0,比如如果时间是下午3点20分9秒的话,则显示15:20:09
            MM=checkTime(MM);
            dd=checkTime(dd);
            mm=checkTime(mm);
            ss=checkTime(ss);
            var day; //用于保存星期(getDay()方法得到星期编号)
            if(today.getDay()==0)   day   =   "星期日 "
            if(today.getDay()==1)   day   =   "星期一 "
            if(today.getDay()==2)   day   =   "星期二 "
            if(today.getDay()==3)   day   =   "星期三 "
            if(today.getDay()==4)   day   =   "星期四 "
            if(today.getDay()==5)   day   =   "星期五 "
            if(today.getDay()==6)   day   =   "星期六 "
            document.getElementById('nowDateTimeSpan').innerHTML=yyyy+"-"+MM +"-"+ dd +" " + hh+":"+mm+":"+ss+"   " + day;
            setTimeout('startTime()',1000);//每一秒中重新加载startTime()方法
        }

        function checkTime(i)
        {
            if (i<10){
                i="0" + i;
            }
            return i;
        }
    </script>
</head>

<body class="theme-black" style="background-color: #17253f !important;" onload="startTime()">
<nav class="navbar" style="background-color: red">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="index.html">工厂产能监控系统</a>
        </div>
        <div style="color: #ffffff"><img src="images/logo.jpg" style="width: 10%"> 深圳市度彼电子有限公司——</div>
        <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
    </div>
     <!--   <div class="collapse navbar-collapse" id="navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <!-- Call Search -->
         <!--       <li><a href="javascript:void(0);" class="js-search" data-close="true"><i class="material-icons">search</i></a></li>
                <!-- #END# Call Search -->
                <!-- Notifications -->
    <!--            <li class="dropdown">
                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button">
                        <i class="material-icons">notifications</i>
                        <span class="label-count">7</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">NOTIFICATIONS</li>
                        <li class="body">
                            <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 254px;"><ul class="menu" style="overflow: hidden; width: auto; height: 254px;">
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-light-green">
                                            <i class="material-icons">person_add</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4>12 new members joined</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 14 mins ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-cyan">
                                            <i class="material-icons">add_shopping_cart</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4>4 sales made</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 22 mins ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-red">
                                            <i class="material-icons">delete_forever</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4><b>Nancy Doe</b> deleted account</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 3 hours ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-orange">
                                            <i class="material-icons">mode_edit</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4><b>Nancy</b> changed name</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 2 hours ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-blue-grey">
                                            <i class="material-icons">comment</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4><b>John</b> commented your post</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 4 hours ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-light-green">
                                            <i class="material-icons">cached</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4><b>John</b> updated status</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> 3 hours ago
                                            </p>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <div class="icon-circle bg-purple">
                                            <i class="material-icons">settings</i>
                                        </div>
                                        <div class="menu-info">
                                            <h4>Settings updated</h4>
                                            <p>
                                                <i class="material-icons">access_time</i> Yesterday
                                            </p>
                                        </div>
                                    </a>
                                </li>
                            </ul><div class="slimScrollBar" style="background: rgba(0, 0, 0, 0.5); width: 4px; position: absolute; top: 0px; opacity: 0.4; display: block; border-radius: 0px; z-index: 99; right: 1px;"></div><div class="slimScrollRail" style="width: 4px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 0px; background: rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div></div>
                        </li>
                        <li class="footer">
                            <a href="javascript:void(0);" class=" waves-effect waves-block">View All Notifications</a>
                        </li>
                    </ul>
                </li>
                <!-- #END# Notifications -->
                <!-- Tasks -->
    <!--           <li class="dropdown">
                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button">
                        <i class="material-icons">flag</i>
                        <span class="label-count">9</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">TASKS</li>
                        <li class="body">
                            <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 254px;"><ul class="menu tasks" style="overflow: hidden; width: auto; height: 254px;">
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <h4>
                                            Footer display issue
                                            <small>32%</small>
                                        </h4>
                                        <div class="progress">
                                            <div class="progress-bar bg-pink" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 32%">
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <h4>
                                            Make new buttons
                                            <small>45%</small>
                                        </h4>
                                        <div class="progress">
                                            <div class="progress-bar bg-cyan" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <h4>
                                            Create new dashboard
                                            <small>54%</small>
                                        </h4>
                                        <div class="progress">
                                            <div class="progress-bar bg-teal" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 54%">
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <h4>
                                            Solve transition issue
                                            <small>65%</small>
                                        </h4>
                                        <div class="progress">
                                            <div class="progress-bar bg-orange" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 65%">
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class=" waves-effect waves-block">
                                        <h4>
                                            Answer GitHub questions
                                            <small>92%</small>
                                        </h4>
                                        <div class="progress">
                                            <div class="progress-bar bg-purple" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 92%">
                                            </div>
                                        </div>
                                    </a>
                                </li>
                            </ul><div class="slimScrollBar" style="background: rgba(0, 0, 0, 0.5); width: 4px; position: absolute; top: 0px; opacity: 0.4; display: block; border-radius: 0px; z-index: 99; right: 1px;"></div><div class="slimScrollRail" style="width: 4px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 0px; background: rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div></div>
                        </li>
                        <li class="footer">
                            <a href="javascript:void(0);" class=" waves-effect waves-block">View All Tasks</a>
                        </li>
                    </ul>
                </li>
                <!-- #END# Tasks -->
          <!--      <li class="pull-right"><a href="javascript:void(0);" class="js-right-sidebar" data-close="true"><i class="material-icons">more_vert</i></a></li>
            </ul>
        </div> -->

</nav>
<section style="margin-top: 100px;color: #ffffff" style-height="30-1">
    <div style="width: 38%;float: left">
        <div class="text-center">本拉产能统计</div>
        <table class="table table-bordered text-center" style="color: #ffffff">
            <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">First</th>
                <th scope="col">Last</th>
                <th scope="col">Handle</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <th scope="row">1</th>
                <td>Mark</td>
                <td>Otto</td>
                <td>@mdo</td>
            </tr>
            <tr>
                <th scope="row">2</th>
                <td>Jacob</td>
                <td>Thornton</td>
                <td>@fat</td>
            </tr>
            <tr>
                <th scope="row">3</th>
                <td>Larry</td>
                <td>the Bird</td>
                <td>@twitter</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div style="width: 60%;float: right">
        <div class="text-center">本厂今日生产能手榜</div>
        <table class="table table-bordered text-center" style="color: #ffffff">
            <thead>
            <tr >

                <th scope="col" colspan="2">First</th>

                <th scope="col" colspan="2">Handle</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <th scope="row">1</th>
                <td>Mark</td>
                <td>Otto</td>
                <td>@mdo</td>
            </tr>
            <tr>
                <th scope="row">2</th>
                <td>Jacob</td>
                <td>Thornton</td>
                <td>@fat</td>
            </tr>
            <tr>
                <th scope="row">3</th>
                <td>Larry</td>
                <td>the Bird</td>
                <td>@twitter</td>
            </tr>
            </tbody>
        </table>
    </div>
</section>
<!--<nav class="navbar navbar-expand-lg navbar-light bg-light" style-height="10">-- >
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarTogglerDemo01">
        <a class="navbar-brand" href="#">Hidden brand</a>
        <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
            <li class="nav-item active">
                <a class="nav-link" href="#">生产线<span>1</span>号 </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#"><span id="clockt"></span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link disabled" href="#">Disabled</a>
            </li>
        </ul>
        <form class="form-inline my-2 my-lg-0">
            <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">下班</button>

            <div class="dropdown">
                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"
                        aria-haspopup="true" aria-expanded="false" style="font-size: 0.5em">
                    <div class="row">
                        <div class="col-4">
                            拉长
                        </div>
                        <div class="col-5">
                            张三
                        </div>
                    </div>

                </button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
                    <li><a href="#">更改密码</a></li>
                    <li><a href="#">退出登录</a></li>
                </ul>
            </div>
        </form>
    </div>
</nav>-->
 <!--<section class="content" style="margin: 0 auto; margin-top: 100px;">
    <!--<div class="row"></div>
    <div class="container-fluid " style="margin-bottom: 1em;">
        <div class="row text-center">
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-green hover-expand-effect" style="margin: 0;">
                    <div class="icon">
                        <i class="material-icons">equalizer</i>
                    </div>
                    <div class="content">
                        <div class="row text-center" style="margin: 0 auto">
                            <div class="text" style="font-size: 1.5em;padding-top: 0.2em">合格数:</div>
                            <div class="number" style="font-size: 3em" id="test1"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-red hover-expand-effect" style="margin: 0;">
                    <div class="icon">
                        <i class="material-icons">equalizer</i>
                    </div>
                    <div class="content">
                        <div class="row text-center" style="margin: 0 auto">
                            <div class="text" style="font-size: 1.5em;padding-top: 0.2em">不合格数:</div>
                            <div class="number" style="font-size: 3em" id="test2"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-lime hover-expand-effect" style="margin: 0;">
                    <div class="icon">
                        <i class="material-icons">brightness_low</i>
                    </div>
                    <div class="content">
                        <div class="row text-center" style="margin: 0 auto">
                            <div class="text" style="font-size: 1.5em;padding-top: 0.2em">不良率:</div>
                            <div class="number" style="font-size: 3em" id="test3"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-cyan hover-zoom-effect" style="margin: 0; ">
                    <div class="icon">
                        <i class="material-icons">access_alarm</i>
                    </div>
                    <div class="content">
                        <div class="row text-center" style="margin: 0 auto">
                            <div class="text" style="font-size: 1.5em;padding-top: 0.2em">堆积数:</div>
                            <div class="number" style="font-size: 3em" id="test4"></div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div> -->
    <!--<div class="container-fluid" style="margin-top: 0.5em;padding-top: 1em">

        <!--  <div class="card" style-height="30-8" style="margin: 0 auto;">
            --<div>
                  <div class="" style="">
                      <div class="table-responsive" style="width: 30%;float: left">
                          <table class="table table-hover dashboard-task-infos">
                              <thead>
                              <tr style="border-bottom:3px solid black;">
                                  <th>姓名(工号)</th>
                                  <th>合格数</th>
                                  <th>不合格数</th>

                              </tr>
                              </thead>
                              <tbody id="rank-one">

                              </tbody>
                          </table>
                      </div>
                      <div class="table-responsive" style="width: 30%;float: left;padding-left: 5em">
                          <table class="table table-hover dashboard-task-infos">
                              <thead>
                              <tr style="border-bottom:3px solid black;">
                                  <th>姓名(工号)</th>
                                  <th>合格数</th>
                                  <th>不合格数</th>

                              </tr>
                              </thead>
                              <tbody id="rank-two">

                              </tbody>
                          </table>
                      </div>
                      <div class="table-responsive" style="width: 30%;float: right">
                          <table class="table table-hover dashboard-task-infos">
                              <thead>
                              <tr style="border-bottom:3px solid black;">
                                  <th>姓名(工号)</th>
                                  <th>合格数</th>
                                  <th>不合格数</th>

                              </tr>
                              </thead>
                              <tbody id="rank-three">

                              </tbody>
                          </table>
                      </div>
                  </div>
              </div>
          </div> -->
<section>

<div class="row" style-height="50-8">
    <div id="graph-1"></div>
</div>
    <div class="row " style="height: 10em"></div>
    <div class="row" style-height="30-2">
        <div id="graph-2"></div>
    </div>
</section>

<!-- Jquery Core Js -->
<script src="plugins/jquery/jquery.min.js"></script>

<!-- Bootstrap Core Js -->
<script src="plugins/bootstrap/js/bootstrap.js"></script>

<!-- Select Plugin Js -->
<script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>

<!-- Slimscroll Plugin Js -->
<script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>

<!-- Waves Effect Plugin Js -->
<script src="plugins/node-waves/waves.js"></script>

<!-- Jquery CountTo Plugin Js -->
<script src="plugins/jquery-countto/jquery.countTo.js"></script>

<!-- Morris Plugin Js -->
<script src="plugins/raphael/raphael.min.js"></script>
<script src="plugins/morrisjs/morris.js"></script>

<!-- ChartJs -->
<script src="plugins/chartjs/Chart.bundle.js"></script>

<!-- Flot Charts Plugin Js -->
<script src="plugins/flot-charts/jquery.flot.js"></script>
<script src="plugins/flot-charts/jquery.flot.resize.js"></script>
<script src="plugins/flot-charts/jquery.flot.pie.js"></script>
<script src="plugins/flot-charts/jquery.flot.categories.js"></script>
<script src="plugins/flot-charts/jquery.flot.time.js"></script>

<!-- Sparkline Chart Plugin Js -->
<script src="plugins/jquery-sparkline/jquery.sparkline.js"></script>

<!-- Custom Js -->
<script src="js/admin.js"></script>
<!--<script src="js/pages/index.js"></script>-->

<!-- Demo Js -->
<script src="js/demo.js"></script>
<script src="js/basic.js"></script>

<script>

   /* function getSpotHtml(htmlbody, one_person, i) {
        htmlbody += "<tr>";
        htmlbody += `<tr>
                                            <td>${flowData[i].spotName}(${flowData[i].spotId})</td>
                                            <td>${passNumber[i]}</td>
                                            <td>${failNumber[i]}</td>
                                        </tr>`;
        htmlbody += "</tr>";
        return htmlbody;
    }

    function showEachSpot() {
        var htmlbody = "", one_person = "";
        var i = 0;
        var triGap = Math.floor(sID.length / 3) + 1;
        var remain = sID.length - triGap * 2;
        htmlbody = "";
        for (i = 0; i < triGap; i++) {
            one_person = namedata[i];
            htmlbody = getSpotHtml(htmlbody, one_person, i);
        }
        $("#rank-one").html(htmlbody);

        htmlbody = "";
        for (i = 0; i < triGap; i++) {
            one_person = namedata[i + triGap];
            htmlbody = getSpotHtml(htmlbody, one_person, i + triGap);
        }
        console.log(htmlbody);
        $("#rank-two").html(htmlbody);

        htmlbody = "";
        for (i = 0; i < remain; i++) {
            one_person = namedata[i + triGap * 2];
            htmlbody = getSpotHtml(htmlbody, one_person, i + triGap * 2);
        }
        $("#rank-three").html(htmlbody);
    }*/

    var thisPageFlow = 1;

    function showChart() {

        var data = [];
        var ratedata = [];
        var stackmax = 0;
        var failmax = 0;
        var passdata=[];
        var faildata=[];

        for (i = 0; i < passNumber.length; i++) {
            if (stackmax < stackeverynum[i]) {
                stackmax = stackeverynum[i];
            }
            if (failmax < failrate[i]) {
                failmax = failrate[i];
            }
            data.push(stackeverynum[i]);
            ratedata.push(Math.floor(failrate[i]));
            passdata.push(passNumber[i]);
            faildata.push(failNumber[i])
        }

        //showEachSpot();

        stackmax = Math.max(stackmax, 5);
        failmax = Math.max(failmax, 5);

        stackAndFailChart = Highcharts.chart('graph-1', {
            chart: {
                zoomType: 'xy',
                height: (4 / 16 * 100) + '%' // 16:9 ratio
            },
            title: {
                text: '各工位今日产能'
            },
            credits: {
                enabled: false // 禁用版权信息
            },
            exporting: {
                enabled: false
            },
            xAxis: [{
                categories: namedata,
                crosshair: true,
                title: {
                    text: '员工',
                    style: {
                        fontSize: '1.5em'
                    }
                },
                labels: {
                    style: {
                        fontSize: '1.5em'
                    }
                }
            }],
            yAxis: [{ // Primary yAxis
                labels: {
                    format: '{value}',
                    style: {
                        color: Highcharts.getOptions().colors[0],
                        fontSize: '1.5em'
                    }
                },
                min: 0,
                max: 10000,
                title: {

                    style: {
                        color: Highcharts.getOptions().colors[0],
                        fontSize: '1em'
                    }
                }
            },
             ],
            tooltip: {
                shared: true
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                x: -100,
                verticalAlign: 'top',
                y: 0,
                floating: true,
                backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
            },
            series: [{
                type: 'column',
                data: passdata,

            }, {
                type: 'column',
                data: faildata,

            },
                {
                    type: 'column',
                    data: data,

                },]
        });
        FailChart = Highcharts.chart('graph-2', {
            chart: {
                zoomType: 'xy',
                height: (4 / 16 * 100) + '%' // 16:9 ratio
            },
            title: {
                text: '各工位今日不良率'
            },
            credits: {
                enabled: false // 禁用版权信息
            },
            exporting: {
                enabled: false
            },
            xAxis: [{
                categories: namedata,
                crosshair: true,
                title: {
                    text: '员工',
                    style: {
                        fontSize: '1.5em'
                    }
                },
                labels: {
                    style: {
                        fontSize: '1.5em'
                    }
                }
            }],
            yAxis: [ { // Secondary yAxis
                title: {
                    text: '不良率',
                    style: {
                        color: 'red',
                        fontSize: '1em'
                    }
                },
                min: 0,
                max: 1.5 * failmax,
                labels: {
                    formatter: function () {
                        return Math.floor(this.value) + "%";
                    },
                    style: {
                        color: 'red',
                        fontSize: '20px'
                    }
                },

            }],
            tooltip: {
                shared: true
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                x: -120,
                verticalAlign: 'top',
                y: 0,
                floating: true,
                backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
            },
            series: [{
                name: '不良率',
                type: 'spline',
                yAxis: 1,
                data: ratedata,
                color: 'red',
                tooltip: {
                    valueSuffix: '%'
                }
            }]
        });

    }

    function updateChart() {
        var data = [];
        var ratedata = [];
        var stackmax = 0;
        var failmax = 0;

        for (i = 0; i < passNumber.length; i++) {
            if (stackmax < stackeverynum[i]) {
                stackmax = stackeverynum[i];
            }
            if (failmax < failrate[i]) {
                failmax = failrate[i];
            }
            data.push(stackeverynum[i]);
            ratedata.push(Math.floor(failrate[i]));
        }

        stackmax = Math.max(stackmax, 5);
        failmax = Math.max(failmax, 5);
        // https://api.hcharts.cn/highcharts#Series.addPoint;
        stackAndFailChart.series[0].setData(data);
        stackAndFailChart.series[1].setData(ratedata);
       // showEachSpot();
    }

    var stackAndFailChart = null;
   var FailChart = null;

    $(document).ready(on_document_load);





    window.onresize = resizeAll;

    function resizeAll() {
        $('[style-height="10"]').height(window.innerHeight / 10);
        $('[style-height="20"]').each(function(one,items){$(items).height(window.innerHeight / 5)});
        $('[style-height="30"]').each(function(one,items){$(items).height(window.innerHeight * 0.4)});
        $('[style-height="40"]').height(window.innerHeight *0.4);
        $('[style-height="30-8"]').height(window.innerHeight * 0.4 - 220);
        $('[style-height="30-1"]').each(function(one,items){$(items).height(window.innerHeight * 0.3)});
        $('[style-height="30-2"]').each(function(one,items){$(items).height(window.innerHeight * 0.2)});
       var graph = $("#graph-1");
        graph.width(window.innerWidth - 35);
        graph.height(window.innerHeight / 3.333);
        if (graph.highcharts !== undefined) {
            graph.highcharts().reflow();
        }
        var graph = $("#graph-2");
        graph.width(window.innerWidth - 35);
        graph.height(window.innerHeight / 3.333);
        if (graph.highcharts !== undefined) {
            graph.highcharts().reflow();
        }
    }

    setInterval(function () {
        resizeAll();
    }, 5000);

    resizeAll();













    //startClock();

</script>
</body>

</html>


<!---
###  SVR_BASE 类似 "http://127.0.0.1:8803"  实际上线之后是确定值,写死在HTML里的JS里面


###  各个拉实时产量数据接口地址
SVR_BASE + "/server/fcWorkRaw/allFlows"

###  单个拉内,所有工位实时产量数据接口地址   e.g. 拉线ID = 2
SVR_BASE + "/server/fcWorkRaw/allSpots" + "?" + "flowId=2"


###  员工上班记录API     e.g. 拉线ID = 2    工位顺序 = 1    员工ID = 33404
SVR_BASE + "/server/fcWorkStartend/goOnline" + "?" + "flowId=2&sequence=1&workerId=33404"

### 查询已上班员工    e.g. 拉线ID = 2
SVR_BASE + "/server/fcWorkRaw/getAll" + "?" + "flowId=2"
-->