123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854 |
- <!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="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
- <!-- Bootstrap Core Css -->
- <link rel="stylesheet" href="css/third/bootstrap.min.css" >
- <!-- 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-frontend.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="css/third/jq.3.2.1.min.js"></script>
- <script src="css/third/popper.1.12.9.js" ></script>
- <script src="css/third/boot.min.js" ></script>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <style>
- /* css 代码 */
- </style>
- <script src="css/third/hchart.js"></script>
- <script src="https://img.hcharts.cn/highcharts/highcharts-more.js"></script>
- <script src="css/third/exporting.js"></script>
- <script src="css/third/cn.js"></script>
- </head>
- <body class="theme-red">
- <script>
- function addContent(name){
- console.log( $(name));
- $(name).tab('show');
- }
- </script>
- <section class="content" style="margin: 0 auto">
- <div class="container-fluid">
- <!-- Widgets -->
- <div class="row" >
- <div class=" col-lg-2 col-md-2 col-sm-6 col-xs-12" >
- <div class="info-box bg-pink text-center " onclick="addContent('#capacity-tab')" >
- <div class="row text-center" style="">
- <div class="col-12">产能</div>
- <div class="col-12">1224123</div>
- </div>
- </div>
- </div>
- <div class=" col-lg-2 col-md-2 col-sm-6 col-xs-12" >
- <div class="info-box bg-pink text-center " onclick="addContent('#home-tab')" >
- <div class="row text-center" style="">
- <div class="col-12">合格数</div>
- <div class="col-12">123123</div>
- </div>
- </div>
- </div>
- <div class="col-lg-2 col-md-2 col-sm-6 col-xs-12">
- <div class="info-box bg-cyan "onclick="addContent('#profile-tab')">
- <div class="row text-center" style="">
- <div class="col-12">不合格数</div>
- <div class="col-12">555</div>
- </div>
- </div>
- </div>
- <div class="col-lg-2 col-md-2 col-sm-6 col-xs-12">
- <div class="info-box bg-light-green " onclick="addContent('#contact-tab')">
- <div class="row text-center" style="">
- <div class="col-12">堆积数</div>
- <div class="col-12">4445</div>
- </div>
- </div>
- </div>
- <div class="col-lg-2 col-md-2 col-sm-6 col-xs-12">
- <div class="info-box bg-orange " onclick="addContent('#time-tab')">
- <div class="row text-center" style="">
- <div class="col-12">工作时长</div>
- <div class="col-12">2245</div>
- </div>
- </div>
- </div>
- <div class="col-lg-2 col-md-2 col-sm-6 col-xs-12">
- <div class="info-box bg-orange " onclick="addContent('#Unqualified-tab')">
- <div class="row text-center" style="">
- <div class="col-12">不良率</div>
- <div class="col-12">20%</div>
- </div>
- </div>
- </div>
- </div>
- <div>
- <ul class="nav nav-tabs" id="myTab" role="tablist" style="display: none">
- <li class="nav-item">
- <a class="nav-link active" id="capacity-tab" data-toggle="tab" href="#capacity" role="tab" aria-controls="capacity" aria-selected="true">Capacity</a>
- </li>
- <li class="nav-item">
- <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="profile-tab" data-toggle="tab" href="#ppr" role="tab" aria-controls="ppr" aria-selected="false">Profile</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Contact</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="time-tab" data-toggle="tab" href="#time" role="tab" aria-controls="time" aria-selected="false">Time</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" id="Unqualified-tab" data-toggle="tab" href="#Unqualified" role="tab" aria-controls="Unqualified" aria-selected="false">Unqualified</a>
- </li>
- </ul>
- <div class="tab-content" id="myTabContent">
- <div class="tab-pane" id="capacity" role="tabpanel" aria-labelledby="capacity-tab">
- <div id="container0"class="text-center" style="width: 100%;height:300px;margin: 0 auto"></div>
- </div>
- <div class="tab-pane" id="home" role="tabpanel" aria-labelledby="home-tab">
- <div id="container1"class="text-center" style="width: 100%;height:300px;margin: 0 auto"></div>
- </div>
- <div class="tab-pane" id="ppr" role="tabpanel" aria-labelledby="profile-tab">
- <div id="container2" style="width:100%;height:300px;margin: 0 auto"></div>
- </div>
- <div class="tab-pane" id="contact" role="tabpanel" aria-labelledby="contact-tab">
- <div id="container3" style="width:100%;height:300px;margin: 0 auto"></div>
- </div>
- <div class="tab-pane" id="time" role="tabpanel" aria-labelledby="time-tab">
- <div id="container4" style="width:100%;height:300px;margin: 0 auto"></div>
- </div>
- <div class="tab-pane" id="Unqualified" role="tabpanel" aria-labelledby="Unqualified-tab">
- <div id="container5" style="width:100%;height:300px;margin: 0 auto"></div>
- </div>
- </div>
- </div>
- <!-- #END# Widgets -->
- <div class="cow">
- <div class="card">
- <div class="body">
- <div class="table-responsive">
- <table class="table table-hover dashboard-task-infos">
- <thead>
- <tr>
- <th>不良工位</th>
- <th>数量</th>
- <th>良品工位</th>
- <th>数量</th>
- </tr>
- </thead>
- <tbody id="rank-one">
- <tr>
- <td>张三</td>
- <td>11</td>
- <td>Task A</td>
- <td>22</td>
- </tr>
- <tr>
- <td>李四</td>
- <td>33</td>
- <td>Task B</td>
- <td>44</td>
- </tr>
- <tr>
- <td>王五</td>
- <td>21</td>
- <td>Task C</td>
- <td>12</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <!-- CPU Usage -->
- <div class="row clearfix">
- <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
- <div class="card">
- <div class="header">
- <div class="row clearfix">
- <div class="col-xs-12 col-sm-6">
- <h2>CPU USAGE (%)</h2>
- </div>
- <div class="col-xs-12 col-sm-6 align-right">
- <div class="switch panel-switch-btn">
- <span class="m-r-10 font-12">REAL TIME</span>
- <label>OFF<input type="checkbox" id="realtime" checked><span class="lever switch-col-cyan"></span>ON</label>
- </div>
- </div>
- </div>
- <ul class="header-dropdown m-r--5">
- <li class="dropdown">
- <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
- <i class="material-icons">more_vert</i>
- </a>
- <ul class="dropdown-menu pull-right">
- <li><a href="javascript:void(0);">Action</a></li>
- <li><a href="javascript:void(0);">Another action</a></li>
- <li><a href="javascript:void(0);">Something else here</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="body">
- <div id="real_time_chart" class="dashboard-flot-chart"></div>
- </div>
- </div>
- </div>
- </div>
- <!-- #END# CPU Usage -->
- <div class="row clearfix">
- <!-- Visitors -->
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="card">
- <div class="body bg-pink">
- <div class="sparkline" data-type="line" data-spot-Radius="4" data-highlight-Spot-Color="rgb(233, 30, 99)" data-highlight-Line-Color="#fff"
- data-min-Spot-Color="rgb(255,255,255)" data-max-Spot-Color="rgb(255,255,255)" data-spot-Color="rgb(255,255,255)"
- data-offset="90" data-width="100%" data-height="92px" data-line-Width="2" data-line-Color="rgba(255,255,255,0.7)"
- data-fill-Color="rgba(0, 188, 212, 0)">
- 12,10,9,6,5,6,10,5,7,5,12,13,7,12,11
- </div>
- <ul class="dashboard-stat-list">
- <li>
- TODAY
- <span class="pull-right"><b>1 200</b> <small>USERS</small></span>
- </li>
- <li>
- YESTERDAY
- <span class="pull-right"><b>3 872</b> <small>USERS</small></span>
- </li>
- <li>
- LAST WEEK
- <span class="pull-right"><b>26 582</b> <small>USERS</small></span>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <!-- #END# Visitors -->
- <!-- Latest Social Trends -->
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="card">
- <div class="body bg-cyan">
- <div class="m-b--35 font-bold">LATEST SOCIAL TRENDS</div>
- <ul class="dashboard-stat-list">
- <li>
- #socialtrends
- <span class="pull-right">
- <i class="material-icons">trending_up</i>
- </span>
- </li>
- <li>
- #materialdesign
- <span class="pull-right">
- <i class="material-icons">trending_up</i>
- </span>
- </li>
- <li>#adminbsb</li>
- <li>#freeadmintemplate</li>
- <li>#bootstraptemplate</li>
- <li>
- #freehtmltemplate
- <span class="pull-right">
- <i class="material-icons">trending_up</i>
- </span>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <!-- #END# Latest Social Trends -->
- <!-- Answered Tickets -->
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="card">
- <div class="body bg-teal">
- <div class="font-bold m-b--35">ANSWERED TICKETS</div>
- <ul class="dashboard-stat-list">
- <li>
- TODAY
- <span class="pull-right"><b>12</b> <small>TICKETS</small></span>
- </li>
- <li>
- YESTERDAY
- <span class="pull-right"><b>15</b> <small>TICKETS</small></span>
- </li>
- <li>
- LAST WEEK
- <span class="pull-right"><b>90</b> <small>TICKETS</small></span>
- </li>
- <li>
- LAST MONTH
- <span class="pull-right"><b>342</b> <small>TICKETS</small></span>
- </li>
- <li>
- LAST YEAR
- <span class="pull-right"><b>4 225</b> <small>TICKETS</small></span>
- </li>
- <li>
- ALL
- <span class="pull-right"><b>8 752</b> <small>TICKETS</small></span>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <!-- #END# Answered Tickets -->
- </div>
- <div class="row clearfix">
- <!-- Task Info -->
- <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
- <div class="card">
- <div class="header">
- <h2>TASK INFOS</h2>
- <ul class="header-dropdown m-r--5">
- <li class="dropdown">
- <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
- <i class="material-icons">more_vert</i>
- </a>
- <ul class="dropdown-menu pull-right">
- <li><a href="javascript:void(0);">Action</a></li>
- <li><a href="javascript:void(0);">Another action</a></li>
- <li><a href="javascript:void(0);">Something else here</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="body">
- <div class="table-responsive">
- <table class="table table-hover dashboard-task-infos">
- <thead>
- <tr>
- <th>#</th>
- <th>Task</th>
- <th>Status</th>
- <th>Manager</th>
- <th>Progress</th>
- </tr>
- </thead>
- <tbody >
- <tr>
- <td>2</td>
- <td>Task B</td>
- <td><span class="label bg-blue">To Do</span></td>
- <td>John Doe</td>
- <td>
- <div class="progress">
- <div class="progress-bar bg-blue" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"></div>
- </div>
- </td>
- </tr>
- <tr>
- <td>3</td>
- <td>Task C</td>
- <td><span class="label bg-light-blue">On Hold</span></td>
- <td>John Doe</td>
- <td>
- <div class="progress">
- <div class="progress-bar bg-light-blue" role="progressbar" aria-valuenow="72" aria-valuemin="0" aria-valuemax="100" style="width: 72%"></div>
- </div>
- </td>
- </tr>
- <tr>
- <td>4</td>
- <td>Task D</td>
- <td><span class="label bg-orange">Wait Approvel</span></td>
- <td>John Doe</td>
- <td>
- <div class="progress">
- <div class="progress-bar bg-orange" role="progressbar" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100" style="width: 95%"></div>
- </div>
- </td>
- </tr>
- <tr>
- <td>5</td>
- <td>Task E</td>
- <td>
- <span class="label bg-red">Suspended</span>
- </td>
- <td>John Doe</td>
- <td>
- <div class="progress">
- <div class="progress-bar bg-red" role="progressbar" aria-valuenow="87" aria-valuemin="0" aria-valuemax="100" style="width: 87%"></div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <!-- #END# Task Info -->
- <!-- Browser Usage -->
- <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
- <div class="card">
- <div class="header">
- <h2>BROWSER USAGE</h2>
- <ul class="header-dropdown m-r--5">
- <li class="dropdown">
- <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
- <i class="material-icons">more_vert</i>
- </a>
- <ul class="dropdown-menu pull-right">
- <li><a href="javascript:void(0);">Action</a></li>
- <li><a href="javascript:void(0);">Another action</a></li>
- <li><a href="javascript:void(0);">Something else here</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="body">
- <div id="donut_chart" class="dashboard-donut-chart"></div>
- </div>
- </div>
- </div>
- <!-- #END# Browser Usage -->
- </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>
- function get_data(url, callback){
- if(la.anyone.alldata){
- callback([
- {name:"张三", id:133, approve:300, decline:400, Accumulate:1000,worktime:1},
- {name:"李四", id:133, approve:300, decline:400, Accumulate:1000,worktime:2},
- ]);
- return;
- }
- callback([{x:1527957798468,y:3000},{x:1527957799468,y:3000},{x:1527957800468,y:3000.5},{x:1527957801468,y:3001}]);
- }
- get_data('la.acceptedCount.3600',mmm);
- function mmm(shuju) {
- console.log("------ getting la.acceptedCount.3000 -------")
- console.log(shuju);
- var chart = Highcharts.chart('container1',{
- chart: {
- type: 'spline'
- },
- title: {
- text: '月平均降雨量'
- },
- subtitle: {
- text: '数据来源: WorldClimate.com'
- },
- xAxis: {
- tickInterval: 1000, // 坐标轴刻度间隔为一星期
- tickWidth: 0,
- gridLineWidth: 1,
- // 时间格式化字符
- // 默认会根据当前的刻度间隔取对应的值,即当刻度间隔为一周时,取 week 值
- dateTimeLabelFormats: {
- week: '%Y-%m-%d'
- }
- },
- yAxis: {
- // min: 0,
- // title: {
- // text: '降雨量 (mm)'
- // }
- },
- tooltip: {
- // head + 每个 point + footer 拼接成完整的 table
- headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
- pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
- '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
- footerFormat: '</table>',
- shared: true,
- useHTML: true
- },
- plotOptions: {
- column: {
- borderWidth: 0
- }
- },
- series: [{
- name: '东京',
- data: shuju
- }]
- });
- }
- setInterval(lll,100);
- function lll() {
- }
- get_data("la.anyone.alldata", showAllData);
- function showAllData(shuju){
- var htmlbody = "";
- var i = 0;
- for(i=0; i < shuju.length; i++){
- var one_person = shuju[i];
- htmlbody += "<tr>";
- htmlbody += " <tr>\n" +
- " <td>"+one_person.name+"("+one_person.id+")</td>\n" +
- " <td>"+one_person.approve+"</td>\n" +
- " <td>"+one_person.decline+"</td>\n" +
- " <td>"+one_person.Accumulate+"</td>\n" +
- " <td>"+one_person.worktime+"</td>\n" +
- " <td>\n" +
- " <div class=\"progress\">\n" +
- " <div class=\"progress-bar bg-green\" role=\"progressbar\" aria-valuenow=\"62\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 62%\"></div>\n" +
- " </div>\n" +
- " </td>\n" +
- " </tr>";
- htmlbody += "</tr>";
- }
- $("#rank-one").html(htmlbody);
- }
- </script>
- <script>
- var chart = Highcharts.chart('container0', {
- title: {
- text: '产能'
- },
- /*subtitle: {
- text: '普通的'
- },*/
- xAxis: {
- categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
- },
- series: [{
- type: 'column',
- colorByPoint: true,
- data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
- showInLegend: false
- }]
- });
- </script>
- <script>
- var chart = Highcharts.chart('container1', {
- title: {
- text: '合格数'
- },
- /* subtitle: {
- text: '数据来源:thesolarfoundation.com'
- },*/
- yAxis: {
- title: {
- text: '就业人数'
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'middle'
- },
- plotOptions: {
- series: {
- label: {
- connectorAllowed: false
- },
- pointStart: 2010
- }
- },
- series: [{
- name: '安装,实施人员',
- data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
- }, {
- name: '工人',
- data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
- }, {
- name: '销售',
- data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
- }, {
- name: '项目开发',
- data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
- }, {
- name: '其他',
- data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
- }],
- responsive: {
- rules: [{
- condition: {
- maxWidth: 500
- },
- chartOptions: {
- legend: {
- layout: 'horizontal',
- align: 'center',
- verticalAlign: 'bottom'
- }
- }
- }]
- }
- });
- </script>
- <script>
- var chart = Highcharts.chart('container2', {
- chart: {
- type: 'bar'
- },
- title: {
- text: '不合格数'
- },
- xAxis: {
- categories: ['苹果', '橘子', '梨', '葡萄', '香蕉']
- },
- yAxis: {
- min: 0,
- title: {
- text: '水果消费总量'
- }
- },
- legend: {
- /* 图例显示顺序反转
- * 这是因为堆叠的顺序默认是反转的,可以设置
- * yAxis.reversedStacks = false 来达到类似的效果
- */
- reversed: true
- },
- plotOptions: {
- series: {
- stacking: 'normal'
- }
- },
- series: [{
- name: '小张',
- data: [5, 3, 4, 7, 2]
- }, {
- name: '小彭',
- data: [2, 2, 3, 2, 1]
- }, {
- name: '小潘',
- data: [3, 4, 4, 2, 5]
- }]
- });
- </script>
- <script>
- var chart = Highcharts.chart('container3', {
- chart: {
- type: 'column'
- },
- title: {
- text: '堆积数'
- },
- /*subtitle: {
- text: '数据截止 2017-03,来源: <a href="https://en.wikipedia.org/wiki/List_of_cities_proper_by_population">Wikipedia</a>'
- },*/
- xAxis: {
- type: 'category',
- labels: {
- rotation: -45 // 设置轴标签旋转角度
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: '人口 (百万)'
- }
- },
- legend: {
- enabled: false
- },
- tooltip: {
- pointFormat: '人口总量: <b>{point.y:.1f} 百万</b>'
- },
- series: [{
- name: '总人口',
- data: [
- ['上海', 24.25],
- ['卡拉奇', 23.50],
- ['北京', 21.51],
- ['德里', 16.78],
- ['拉各斯', 16.06],
- ['天津', 15.20],
- ['伊斯坦布尔', 14.16],
- ['东京', 13.51],
- ['广州', 13.08],
- ['孟买', 12.44],
- ['莫斯科', 12.19],
- ['圣保罗', 12.03],
- ['深圳', 10.46],
- ['雅加达', 10.07],
- ['拉合尔', 10.05],
- ['首尔', 9.99],
- ['武汉', 9.78],
- ['金沙萨', 9.73],
- ['开罗', 9.27],
- ['墨西哥', 8.87]
- ],
- dataLabels: {
- enabled: true,
- rotation: -90,
- color: '#FFFFFF',
- align: 'right',
- format: '{point.y:.1f}', // :.1f 为保留 1 位小数
- y: 10
- }
- }]
- });
- </script>
- <script>
- var chart = Highcharts.chart('container4', {
- chart: {
- type: 'line'
- },
- title: {
- text: '工作时长'
- },
- /*/subtitle: {
- text: '数据来源: WorldClimate.com'
- },*/
- xAxis: {
- categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
- },
- yAxis: {
- title: {
- text: '气温 (°C)'
- }
- },
- plotOptions: {
- line: {
- dataLabels: {
- // 开启数据标签
- enabled: true
- },
- // 关闭鼠标跟踪,对应的提示框、点击事件会失效
- enableMouseTracking: false
- }
- },
- series: [{
- name: '东京',
- 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]
- }, {
- name: '伦敦',
- 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]
- }]
- });
- </script>
- <script>
- var chart = Highcharts.chart('container5', {
- chart: {
- type: 'column'
- },
- title: {
- text: '不良率'
- },
- xAxis: {
- categories: ['苹果', '橘子', '梨', '葡萄', '香蕉']
- },
- yAxis: {
- min: 0,
- title: {
- text: '水果消费总量'
- }
- },
- tooltip: {
- pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b>' +
- '({point.percentage:.0f}%)<br/>',
- //:.0f 表示保留 0 位小数,详见教程:https://www.hcharts.cn/docs/basic-labels-string-formatting
- shared: true
- },
- plotOptions: {
- column: {
- stacking: 'percent'
- }
- },
- series: [{
- name: '小张',
- data: [5, 3, 4, 7, 2]
- }, {
- name: '小彭',
- data: [2, 2, 3, 2, 1]
- }, {
- name: '小潘',
- data: [3, 4, 4, 2, 5]
- }]
- });
- </script>
- </body>
- </html>
|