example.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  6. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  7. <title>流水线管理页</title>
  8. <!-- Favicon-->
  9. <link rel="icon" href="favicon.ico" type="image/x-icon">
  10. <!-- Google Fonts -->
  11. <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet"
  12. type="text/css">
  13. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
  14. <!-- Bootstrap Core Css -->
  15. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css"
  16. integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  17. <!-- Waves Effect Css -->
  18. <link href="plugins/node-waves/waves.css" rel="stylesheet"/>
  19. <!-- Animation Css -->
  20. <link href="plugins/animate-css/animate.css" rel="stylesheet"/>
  21. <!-- Morris Chart Css-->
  22. <link href="plugins/morrisjs/morris.css" rel="stylesheet"/>
  23. <!-- Custom Css -->
  24. <link href="css/style.css" rel="stylesheet">
  25. <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
  26. <link href="css/themes/all-themes.css" rel="stylesheet"/>
  27. <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  28. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  29. <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js"
  30. integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
  31. crossorigin="anonymous"></script>
  32. <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js"
  33. integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
  34. crossorigin="anonymous"></script>
  35. <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
  36. <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
  37. <meta name="viewport" content="width=device-width, initial-scale=1">
  38. <style>
  39. /* css 代码 */
  40. </style>
  41. <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
  42. <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
  43. <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
  44. </head>
  45. <body>
  46. <div class="row">
  47. <div class=" col-lg-3 col-md-3 col-sm-6 col-xs-12">
  48. <div class="info-box bg-pink " onclick="addContent1()">
  49. 合格数
  50. <script>
  51. function addContent1() {
  52. $('a[href="#home"]').tab('show');
  53. }
  54. </script>
  55. </div>
  56. </div>
  57. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  58. <div class="info-box bg-cyan " onclick="addContent2()">
  59. 不合格数
  60. <script>
  61. function addContent2() {
  62. $('a[href="#profile"]').tab('show');
  63. }
  64. </script>
  65. </div>
  66. </div>
  67. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  68. <div class="info-box bg-light-green " onclick="addContent3()">
  69. 堆积数
  70. <script>
  71. function addContent3() {
  72. $('a[href="#contact"]').tab('show');
  73. }
  74. </script>
  75. </div>
  76. </div>
  77. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  78. <div class="info-box bg-orange " onclick="addContent4()">
  79. 工作时长
  80. <script>
  81. function addContent4() {
  82. $('a[href="#time"]').tab('show');
  83. }
  84. </script>
  85. </div>
  86. </div>
  87. </div>
  88. <div>
  89. <ul class="nav nav-tabs" id="myTab" role="tablist" style="display: none">
  90. <li class="nav-item">
  91. <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
  92. aria-selected="true">Home</a>
  93. </li>
  94. <li class="nav-item">
  95. <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
  96. aria-selected="false">Profile</a>
  97. </li>
  98. <li class="nav-item">
  99. <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact"
  100. aria-selected="false">Contact</a>
  101. </li>
  102. <li class="nav-item">
  103. <a class="nav-link" id="time-tab" data-toggle="tab" href="#time" role="tab" aria-controls="time"
  104. aria-selected="false">Time</a>
  105. </li>
  106. </ul>
  107. <div class="tab-content" id="myTabContent">
  108. <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
  109. <div id="container" class="text-center" style="width: 50%;height:400px;margin: 0 auto"></div>
  110. </div>
  111. <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
  112. <div id="container2" style="width:50%;height:400px;margin: 0 auto"></div>
  113. </div>
  114. <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
  115. <div id="container3" style="width:50%;height:400px;margin: 0 auto"></div>
  116. </div>
  117. <div class="tab-pane fade" id="time" role="tabpanel" aria-labelledby="contact-tab">
  118. <div id="container5" style="width:50%;height:400px;margin: 0 auto"></div>
  119. </div>
  120. </div>
  121. </div>
  122. <script>
  123. var chart = Highcharts.chart('container2', {
  124. chart: {
  125. type: 'column'
  126. },
  127. title: {
  128. text: '月平均降雨量'
  129. },
  130. subtitle: {
  131. text: '数据来源: WorldClimate.com'
  132. },
  133. xAxis: {
  134. categories: [
  135. '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
  136. ],
  137. crosshair: true
  138. },
  139. yAxis: {
  140. min: 0,
  141. title: {
  142. text: '降雨量 (mm)'
  143. }
  144. },
  145. tooltip: {
  146. // head + 每个 point + footer 拼接成完整的 table
  147. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  148. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  149. '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
  150. footerFormat: '</table>',
  151. shared: true,
  152. useHTML: true
  153. },
  154. plotOptions: {
  155. column: {
  156. borderWidth: 0
  157. }
  158. },
  159. series: [{
  160. name: '东京',
  161. data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
  162. }, {
  163. name: '纽约',
  164. data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3]
  165. }, {
  166. name: '伦敦',
  167. data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2]
  168. }, {
  169. name: '柏林',
  170. data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1]
  171. }]
  172. });
  173. </script>
  174. <script>
  175. var chart = Highcharts.chart('container1', {
  176. chart: {
  177. type: 'bar'
  178. },
  179. title: {
  180. text: '堆叠条形图'
  181. },
  182. xAxis: {
  183. categories: ['苹果', '橘子', '梨', '葡萄', '香蕉']
  184. },
  185. yAxis: {
  186. min: 0,
  187. title: {
  188. text: '水果消费总量'
  189. }
  190. },
  191. legend: {
  192. /* 图例显示顺序反转
  193. * 这是因为堆叠的顺序默认是反转的,可以设置
  194. * yAxis.reversedStacks = false 来达到类似的效果
  195. */
  196. reversed: true
  197. },
  198. plotOptions: {
  199. series: {
  200. stacking: 'normal'
  201. }
  202. },
  203. series: [{
  204. name: '小张',
  205. data: [5, 3, 4, 7, 2]
  206. }, {
  207. name: '小彭',
  208. data: [2, 2, 3, 2, 1]
  209. }, {
  210. name: '小潘',
  211. data: [3, 4, 4, 2, 5]
  212. }]
  213. });
  214. </script>
  215. <script>
  216. var chart = Highcharts.chart('container3', {
  217. chart: {
  218. type: 'column'
  219. },
  220. title: {
  221. text: '全球各大城市人口排行'
  222. },
  223. subtitle: {
  224. text: '数据截止 2017-03,来源: <a href="https://en.wikipedia.org/wiki/List_of_cities_proper_by_population">Wikipedia</a>'
  225. },
  226. xAxis: {
  227. type: 'category',
  228. labels: {
  229. rotation: -45 // 设置轴标签旋转角度
  230. }
  231. },
  232. yAxis: {
  233. min: 0,
  234. title: {
  235. text: '人口 (百万)'
  236. }
  237. },
  238. legend: {
  239. enabled: false
  240. },
  241. tooltip: {
  242. pointFormat: '人口总量: <b>{point.y:.1f} 百万</b>'
  243. },
  244. series: [{
  245. name: '总人口',
  246. data: [
  247. ['上海', 24.25],
  248. ['卡拉奇', 23.50],
  249. ['北京', 21.51],
  250. ['德里', 16.78],
  251. ['拉各斯', 16.06],
  252. ['天津', 15.20],
  253. ['伊斯坦布尔', 14.16],
  254. ['东京', 13.51],
  255. ['广州', 13.08],
  256. ['孟买', 12.44],
  257. ['莫斯科', 12.19],
  258. ['圣保罗', 12.03],
  259. ['深圳', 10.46],
  260. ['雅加达', 10.07],
  261. ['拉合尔', 10.05],
  262. ['首尔', 9.99],
  263. ['武汉', 9.78],
  264. ['金沙萨', 9.73],
  265. ['开罗', 9.27],
  266. ['墨西哥', 8.87]
  267. ],
  268. dataLabels: {
  269. enabled: true,
  270. rotation: -90,
  271. color: '#FFFFFF',
  272. align: 'right',
  273. format: '{point.y:.1f}', // :.1f 为保留 1 位小数
  274. y: 10
  275. }
  276. }]
  277. });
  278. </script>
  279. <script>
  280. var chart = Highcharts.chart('container4', {
  281. chart: {
  282. type: 'line'
  283. },
  284. title: {
  285. text: '月平均气温'
  286. },
  287. subtitle: {
  288. text: '数据来源: WorldClimate.com'
  289. },
  290. xAxis: {
  291. categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
  292. },
  293. yAxis: {
  294. title: {
  295. text: '气温 (°C)'
  296. }
  297. },
  298. plotOptions: {
  299. line: {
  300. dataLabels: {
  301. // 开启数据标签
  302. enabled: true
  303. },
  304. // 关闭鼠标跟踪,对应的提示框、点击事件会失效
  305. enableMouseTracking: false
  306. }
  307. },
  308. series: [{
  309. name: '东京',
  310. data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
  311. }, {
  312. name: '伦敦',
  313. data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
  314. }]
  315. });
  316. </script>
  317. <script src="js/basic.js"></script>
  318. <script>
  319. var thisPageFlow = 1;
  320. function showChart() {
  321. var data = [];
  322. var ratedata = [];
  323. var stackmax = 0;
  324. var failmax=0;
  325. for (i = 0; i < passNumber.length; i++) {
  326. if (stackmax < stackeverynum[i]) {
  327. stackmax = stackeverynum[i];
  328. }
  329. if (failmax < failrate[i]) {
  330. failmax = failrate[i];
  331. }
  332. data.push(stackeverynum[i]);
  333. ratedata.push(Math.floor(failrate[i]));
  334. }
  335. stackmax = Math.max(stackmax,5);
  336. failmax =Math.max(failmax,5);
  337. stackAndFailChart = Highcharts.chart('container', {
  338. chart: {
  339. zoomType: 'xy'
  340. },
  341. title: {
  342. text: null
  343. },
  344. credits: {
  345. enabled: false // 禁用版权信息
  346. },
  347. exporting: {
  348. enabled: false
  349. },
  350. xAxis: [{
  351. categories: namedata,
  352. crosshair: true,
  353. title: {
  354. text: '员工',
  355. style: {
  356. fontSize: '15px'
  357. }
  358. },
  359. labels: {
  360. style: {
  361. fontSize: '20px'
  362. }
  363. }
  364. }],
  365. yAxis: [{ // Primary yAxis
  366. labels: {
  367. format: '{value}',
  368. style: {
  369. color: Highcharts.getOptions().colors[0],
  370. fontSize: '20px'
  371. }
  372. },
  373. min: 0,
  374. max: 1.5 * stackmax,
  375. title: {
  376. text: '堆积数',
  377. style: {
  378. color: Highcharts.getOptions().colors[0],
  379. fontSize: '15px'
  380. }
  381. }
  382. }, { // Secondary yAxis
  383. title: {
  384. text: '不良率',
  385. style: {
  386. color: 'red',
  387. fontSize: '15px'
  388. }
  389. },
  390. min: 0,
  391. max: 1.5 * failmax,
  392. labels: {
  393. formatter: function() {
  394. return Math.floor(this.value) + "%";
  395. },
  396. style: {
  397. color: 'red',
  398. fontSize: '20px'
  399. }
  400. },
  401. opposite: true
  402. }],
  403. tooltip: {
  404. shared: true
  405. },
  406. legend: {
  407. layout: 'vertical',
  408. align: 'right',
  409. x: -120,
  410. verticalAlign: 'top',
  411. y: 0,
  412. floating: true,
  413. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  414. },
  415. series: [{
  416. name: '堆积数',
  417. type: 'column',
  418. data: data,
  419. tooltip: {
  420. valueSuffix: ' mm'
  421. }
  422. }, {
  423. name: '不良率',
  424. type: 'spline',
  425. yAxis: 1,
  426. data: ratedata,
  427. color: 'red',
  428. tooltip: {
  429. valueSuffix: '%'
  430. }
  431. }]
  432. });
  433. }
  434. function updateChart(){
  435. var data = [];
  436. var ratedata = [];
  437. var stackmax = 0;
  438. var failmax=0;
  439. for (i = 0; i < passNumber.length; i++) {
  440. if (stackmax < stackeverynum[i]) {
  441. stackmax = stackeverynum[i];
  442. }
  443. if (failmax < failrate[i]) {
  444. failmax = failrate[i];
  445. }
  446. data.push(stackeverynum[i]);
  447. ratedata.push(Math.floor(failrate[i]));
  448. }
  449. stackmax = Math.max(stackmax,5);
  450. failmax =Math.max(failmax,5);
  451. // https://api.hcharts.cn/highcharts#Series.addPoint;
  452. stackAndFailChart.series[0].setData(data);
  453. stackAndFailChart.series[1].setData(ratedata);
  454. }
  455. var stackAndFailChart = null;
  456. $(document).ready(on_document_load);
  457. setInterval(function(){
  458. $("#container").width(window.innerWidth);
  459. $("#container").height(window.innerHeight);
  460. },1000);
  461. </script>
  462. </body>
  463. </html>