123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <!-- Meta, title, CSS, favicons, etc. -->
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>后台管理系统 </title>
- <!-- Bootstrap -->
- <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
- <!-- Font Awesome -->
- <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
- <!-- iCheck -->
- <link href="../vendors/iCheck/skins/flat/blue.css" rel="stylesheet">
- <!-- bootstrap-daterangepicker -->
- <link href="../vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
- <!-- bootstrap-datetimepicker -->
- <link href="../vendors/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
- <!-- Datatables -->
- <link href="../vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
- <!-- Custom Theme Style -->
- <link href="../src/css/common.css" rel="stylesheet">
- </head>
- <body class="container child_body">
- <div class="row">
- <div class="col-md-12 col-sm-12 col-xs-24">
- <div class="x_panel">
- <div class="x_title">
- <h2>动态图表示例 </h2>
- <div class="nav navbar-right">
- <ul class="nav navbar-right panel_toolbox">
- <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
- </li>
- </ul>
- </div>
- <div class="clearfix"></div>
- </div>
- <div class="x_content">
- <div style="position: relative; width: 600px; height: 400px;">
- <div id="echart_bar_horizontal" style="height: 100%;"></div>
- <div class="barTime" id="barTime" style="position: absolute; right: 40px; bottom: 60px; z-index: 99; font-size: 58px;">1980</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- jQuery -->
- <script src="../vendors/jquery/dist/jquery.min.js"></script>
- <!-- Bootstrap -->
- <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
- <!-- FastClick -->
- <script src="../vendors/fastclick/lib/fastclick.js"></script>
- <!-- iCheck -->
- <script src="../vendors/iCheck/icheck.min.js"></script>
- <!-- Datatables -->
- <script src="../vendors/datatables.net/js/jquery.dataTables.min.js"></script>
- <script src="../vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
- <script src="../vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
- <script src="../vendors/datatables.net-fixedcolumns/js/dataTables.fixedcolumns.min.js"></script>
- <script src="../vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
- <!-- ECharts -->
- <script src="../vendors/echarts/dist/echarts.min.js"></script>
- <!-- common -->
- <script src="../src/js/common.js"></script>
- <script>
- $(function() {
- var theme = {
- color: [
- '#26B99A', '#34495E', '#BDC3C7', '#3498DB',
- '#9B59B6', '#8abb6f', '#759c6a', '#bfd3b7'
- ],
- title: {
- itemGap: 8,
- textStyle: {
- fontWeight: 'normal',
- color: '#408829'
- }
- },
- dataRange: {
- color: ['#1f610a', '#97b58d']
- },
- toolbox: {
- color: ['#408829', '#408829', '#408829', '#408829']
- },
- tooltip: {
- backgroundColor: 'rgba(0,0,0,0.5)',
- axisPointer: {
- type: 'line',
- lineStyle: {
- color: '#408829',
- type: 'dashed'
- },
- crossStyle: {
- color: '#408829'
- },
- shadowStyle: {
- color: 'rgba(200,200,200,0.3)'
- }
- }
- },
- dataZoom: {
- dataBackgroundColor: '#eee',
- fillerColor: 'rgba(64,136,41,0.2)',
- handleColor: '#408829'
- },
- grid: {
- borderWidth: 0
- },
- categoryAxis: {
- axisLine: {
- lineStyle: {
- color: '#408829'
- }
- },
- splitLine: {
- lineStyle: {
- color: ['#eee']
- }
- }
- },
- valueAxis: {
- axisLine: {
- lineStyle: {
- color: '#408829'
- }
- },
- splitArea: {
- show: true,
- areaStyle: {
- color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
- }
- },
- splitLine: {
- lineStyle: {
- color: ['#eee']
- }
- }
- },
- timeline: {
- lineStyle: {
- color: '#408829'
- },
- controlStyle: {
- normal: {color: '#408829'},
- emphasis: {color: '#408829'}
- }
- },
- k: {
- itemStyle: {
- normal: {
- color: '#68a54a',
- color0: '#a9cba2',
- lineStyle: {
- width: 1,
- color: '#408829',
- color0: '#86b379'
- }
- }
- }
- },
- map: {
- itemStyle: {
- normal: {
- areaStyle: {
- color: '#ddd'
- },
- label: {
- textStyle: {
- color: '#c12e34'
- }
- }
- },
- emphasis: {
- areaStyle: {
- color: '#99d2dd'
- },
- label: {
- textStyle: {
- color: '#c12e34'
- }
- }
- }
- }
- },
- force: {
- itemStyle: {
- normal: {
- linkStyle: {
- strokeColor: '#408829'
- }
- }
- }
- },
- chord: {
- padding: 4,
- itemStyle: {
- normal: {
- lineStyle: {
- width: 1,
- color: 'rgba(128, 128, 128, 0.5)'
- },
- chordStyle: {
- lineStyle: {
- width: 1,
- color: 'rgba(128, 128, 128, 0.5)'
- }
- }
- },
- emphasis: {
- lineStyle: {
- width: 1,
- color: 'rgba(128, 128, 128, 0.5)'
- },
- chordStyle: {
- lineStyle: {
- width: 1,
- color: 'rgba(128, 128, 128, 0.5)'
- }
- }
- }
- }
- },
- gauge: {
- startAngle: 225,
- endAngle: -45,
- axisLine: {
- show: true,
- lineStyle: {
- color: [[0.2, '#86b379'], [0.8, '#68a54a'], [1, '#408829']],
- width: 8
- }
- },
- axisTick: {
- splitNumber: 10,
- length: 12,
- lineStyle: {
- color: 'auto'
- }
- },
- axisLabel: {
- textStyle: {
- color: 'auto'
- }
- },
- splitLine: {
- length: 18,
- lineStyle: {
- color: 'auto'
- }
- },
- pointer: {
- length: '90%',
- color: 'auto'
- },
- title: {
- textStyle: {
- color: '#333'
- }
- },
- detail: {
- textStyle: {
- color: 'auto'
- }
- }
- },
- textStyle: {
- fontFamily: 'Arial, Verdana, sans-serif'
- }
- };
- //echart Bar Horizontal
-
- if ($('#echart_bar_horizontal').length ){
-
- var echartBar = echarts.init(document.getElementById('echart_bar_horizontal'), theme);
- var option = {
- title: {
- text: 'Bar Graph',
- subtext: 'Graph subtitle'
- },
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- x: 100,
- data: ['分类一', '分类二']
- },
- toolbox: {
- show: true,
- feature: {
- saveAsImage: {
- show: true,
- title: "Save Image"
- }
- }
- },
- calculable: true,
- xAxis: [{
- type: 'value',
- boundaryGap: [0, 0.01]
- }],
- yAxis: [{
- type: 'category',
- data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
- }],
- series: [{
- name: '分类一',
- type: 'bar',
- data: [18203, 23489, 29034, 104970, 131744, 530230]
- }, {
- name: '分类二',
- type: 'bar',
- data: [19325, 23438, 31000, 121594, 134141, 581807]
- }]
- };
- echartBar.setOption(option);
- var auto, start = 1980, i = 0, data = option.series;
- auto = setInterval(function() {
- if (i > 20) {
- clearInterval(auto);
- return false;
- }
- i++;
- start += 1;
- option.series.forEach(function(item, idx) {
- // item.data.push(10000 * i * Math.random());
- item.data.forEach(function(val, idx2) {
- val = Math.floor(val + 10000 * i * Math.random());
- data[idx].data[idx2] = val
- })
- // console.log('----------------- ')
- });
- option.series = data
- echartBar.setOption(option, true);
- $('#barTime').text(start);
- }, 2000);
- }
- })
-
- </script>
- </body>
- </html>
|