js.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1.  $(window).load(function(){
  2. $(".loading").fadeOut()
  3. })
  4. /****/
  5. // $(document).ready(function(){
  6. var whei=$(window).width()
  7. $("html").css({fontSize:whei/20})
  8. $(window).resize(function(){
  9. var whei=$(window).width()
  10. $("html").css({fontSize:whei/20})
  11. });
  12. function echarts_1() {
  13. // 基于准备好的dom,初始化echarts实例
  14. var myChart = echarts.init(document.getElementById('echarts1'));
  15. option = {
  16. // backgroundColor: '#00265f',
  17. tooltip: {
  18. trigger: 'axis',
  19. axisPointer: {
  20. type: 'shadow'
  21. }
  22. },
  23. grid: {
  24. left: '0%',
  25. top:'40px',
  26. right: '0%',
  27. bottom: '4%',
  28. containLabel: true
  29. },
  30. xAxis: [{
  31. type: 'category',
  32. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月'],
  33. axisLine: {
  34. show: true,
  35. lineStyle: {
  36. color: "rgba(255,255,255,.1)",
  37. width: 1,
  38. type: "solid"
  39. },
  40. },
  41. axisTick: {
  42. show: false,
  43. },
  44. axisLabel: {
  45. interval: 0,
  46. // rotate:50,
  47. show: true,
  48. splitNumber: 15,
  49. textStyle: {
  50. color: "rgba(255,255,255,.6)",
  51. fontSize: '12',
  52. },
  53. },
  54. }],
  55. yAxis: [{
  56. type: 'value',
  57. axisLabel: {
  58. //formatter: '{value} %'
  59. show:true,
  60. textStyle: {
  61. color: "rgba(255,255,255,.6)",
  62. fontSize: '12',
  63. },
  64. },
  65. axisTick: {
  66. show: false,
  67. },
  68. axisLine: {
  69. show: true,
  70. lineStyle: {
  71. color: "rgba(255,255,255,.1 )",
  72. width: 1,
  73. type: "solid"
  74. },
  75. },
  76. splitLine: {
  77. lineStyle: {
  78. color: "rgba(255,255,255,.1)",
  79. }
  80. }
  81. }],
  82. series: [
  83. {
  84. type: 'bar',
  85. data: [200, 300, 300, 900, 2500, 1200, 600],
  86. barWidth:'35%', //柱子宽度
  87. // barGap: 1, //柱子之间间距
  88. itemStyle: {
  89. normal: {
  90. color:'#2f89cf',
  91. opacity: 1,
  92. barBorderRadius: 5,
  93. }
  94. }
  95. }
  96. ]
  97. };
  98. // 使用刚指定的配置项和数据显示图表。
  99. myChart.setOption(option);
  100. window.addEventListener("resize",function(){
  101. myChart.resize();
  102. });
  103. }
  104. function echarts_2() {
  105. // 基于准备好的dom,初始化echarts实例
  106. var myChart = echarts.init(document.getElementById('echarts2'));
  107. option = {
  108. title: [{
  109. text: '',
  110. left: 'center',
  111. textStyle: {
  112. color: '#fff',
  113. fontSize:'16'
  114. }
  115. }],
  116. tooltip: {
  117. trigger: 'item',
  118. formatter: "{a} <br/>{b}: {c} ({d}%)",
  119. position:function(p){ //其中p为当前鼠标的位置
  120. return [p[0] + 10, p[1] - 10];
  121. }
  122. },
  123. legend: {
  124. // top:'70%',
  125. // itemWidth: 10,
  126. // itemHeight: 10,
  127. // data:['故障','离线','在线'],
  128. // textStyle: {
  129. // color: 'rgba(255,255,255,.5)',
  130. // fontSize:'12',
  131. // }
  132. x: '90%',
  133. y: 'center',
  134. orient: 'vertical',
  135. itemGap: 12, //图例每项之间的间隔
  136. itemWidth: 10,
  137. itemHeight: 10,
  138. icon: 'rect',
  139. data:['故障','离线','在线'],
  140. textStyle: {
  141. color: [],
  142. fontStyle: 'normal',
  143. fontFamily: '微软雅黑',
  144. fontSize: 12,
  145. }
  146. },
  147. series: [
  148. {
  149. name:'基站状态',
  150. type:'pie',
  151. clockwise: false, //饼图的扇区是否是顺时针排布
  152. // minAngle: 20, //最小的扇区角度(0 ~ 360)
  153. center: ['50%', '50%'],
  154. radius: ['40%', '60%'],
  155. color: ['#ff1111', '#0699ff', '#06ffab'],
  156. label: {
  157. show:true,
  158. normal: {
  159. show: true,
  160. position: 'outside', //标签的位置
  161. formatter: "{b}:{d}%",
  162. textStyle: {
  163. color: '#fff',
  164. }
  165. },
  166. emphasis: {
  167. show: true,
  168. textStyle: {
  169. fontWeight: 'bold'
  170. }
  171. }
  172. },
  173. labelLine: {
  174. show:true
  175. },
  176. avoidLabelOverlap: true, ////是否启用防止标签重叠
  177. data:[
  178. {value:100, name:'故障'},
  179. {value:400, name:'离线'},
  180. {value:20000, name:'在线'},
  181. ],
  182. // itemStyle: { //图形样式
  183. // normal: {
  184. // borderColor: '#1e2239',
  185. // borderWidth: 1,
  186. // },
  187. // },
  188. }
  189. ]
  190. };
  191. // 使用刚指定的配置项和数据显示图表。
  192. myChart.setOption(option);
  193. window.addEventListener("resize",function(){
  194. myChart.resize();
  195. });
  196. }
  197. function echarts_3() {
  198. // 基于准备好的dom,初始化echarts实例
  199. var myChart = echarts.init(document.getElementById('echarts3'));
  200. option = {
  201. title: [{
  202. text: "",
  203. left: 'center',
  204. textStyle: {
  205. color: '#fff',
  206. fontSize:'16'
  207. }
  208. }],
  209. tooltip: {
  210. trigger: 'item',
  211. formatter: "{a} <br/>{b}: {c} ({d}%)",
  212. position:function(p){ //其中p为当前鼠标的位置
  213. return [p[0] + 10, p[1] - 10];
  214. }
  215. },
  216. legend: {
  217. x: '90%',
  218. y: 'center',
  219. orient: 'vertical',
  220. itemGap: 12, //图例每项之间的间隔
  221. itemWidth: 10,
  222. itemHeight: 10,
  223. icon: 'rect',
  224. data:['破案','追踪','待处理'],
  225. textStyle: {
  226. color: [],
  227. fontStyle: 'normal',
  228. fontFamily: '微软雅黑',
  229. fontSize: 12,
  230. }
  231. },
  232. series: [
  233. {
  234. name:'案件处理',
  235. type:'pie',
  236. clockwise: false, //饼图的扇区是否是顺时针排布
  237. // minAngle: 20, //最小的扇区角度(0 ~ 360)
  238. center: ['50%', '50%'],
  239. radius: ['40%', '60%'],
  240. color: ['#0699ff', '#06ffab','#ff00aa'],
  241. label: {
  242. show:true,
  243. normal: {
  244. show: true,
  245. position: 'outside', //标签的位置
  246. formatter: "{b}:{d}%",
  247. textStyle: {
  248. color: '#fff',
  249. }
  250. },
  251. emphasis: {
  252. show: true,
  253. textStyle: {
  254. fontWeight: 'bold'
  255. }
  256. }
  257. },
  258. labelLine: {
  259. show:true
  260. },
  261. avoidLabelOverlap: true, ////是否启用防止标签重叠
  262. data:[
  263. {value:37,name:'破案'},
  264. {value:7, name:'追踪'},
  265. {value:4, name:'待处理'}
  266. ],
  267. }
  268. ]
  269. };
  270. // 使用刚指定的配置项和数据显示图表。
  271. myChart.setOption(option);
  272. window.addEventListener("resize",function(){
  273. myChart.resize();
  274. });
  275. }
  276. //加载地图
  277. function initMap(){
  278. // 百度地图API功能
  279. var map = new BMap.Map("map_container"); // 创建Map实例
  280. map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); // 初始化地图,设置中心点坐标和地图级别
  281. //添加地图类型控件
  282. var size1 = new BMap.Size(10, 50);
  283. map.addControl(new BMap.MapTypeControl({
  284. offset: size1,
  285. mapTypes:[
  286. BMAP_NORMAL_MAP,
  287. BMAP_HYBRID_MAP,
  288. ]}));
  289. // 编写自定义函数,创建标注
  290. function addMarker(point){
  291. var marker = new BMap.Marker(point);
  292. map.addOverlay(marker);
  293. }
  294. // 随机向地图添加25个标注
  295. var bounds = map.getBounds();
  296. var sw = bounds.getSouthWest();
  297. var ne = bounds.getNorthEast();
  298. var lngSpan = Math.abs(sw.lng - ne.lng);
  299. var latSpan = Math.abs(ne.lat - sw.lat);
  300. for (var i = 0; i < 25; i ++) {
  301. var point = new BMap.Point(sw.lng + lngSpan * (Math.random() * 0.7), ne.lat - latSpan * (Math.random() * 0.7));
  302. addMarker(point);
  303. };
  304. map.setCurrentCity("北京"); // 设置地图显示的城市 此项是必须设置的
  305. map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
  306. //设备地图颜色
  307. var mapStyle={
  308. // style:"midnight"
  309. };
  310. map.setMapStyle(mapStyle);
  311. //加载城市控件
  312. var size = new BMap.Size(10, 50);
  313. map.addControl(new BMap.CityListControl({
  314. anchor: BMAP_ANCHOR_TOP_LEFT,
  315. offset: size,
  316. }));
  317. }
  318. // });