index.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. $(function () {
  2. echart_3();
  3. echart_status_chart();
  4. renderPMChart();
  5. renderEquipmentChart();
  6. renderMTBAChart();
  7. renderAlarmChart();
  8. renderPmCharge();
  9. // 中间机台运行状态占比图
  10. function echart_status_chart() {
  11. var chart = echarts.init(document.getElementById('rateChart'))
  12. var option = {
  13. tooltip: {
  14. trigger: 'item',
  15. formatter: '{b}: {c}台 ({d}%)'
  16. },
  17. series: [
  18. {
  19. name: '稼动',
  20. type: 'pie',
  21. radius: ['50%', '70%'],
  22. center: ['12.5%', '50%'],
  23. avoidLabelOverlap: false,
  24. label: {
  25. show: true,
  26. position: 'center',
  27. fontSize: '16',
  28. fontWeight: 'bold',
  29. formatter: function (param) {
  30. console.log(param);
  31. if (param.dataIndex === 0) {
  32. return param.percent + '%\n'
  33. + param.data.value + '台';
  34. }
  35. return '';
  36. }
  37. },
  38. emphasis: {
  39. label: {
  40. show: false,
  41. fontSize: '20',
  42. fontWeight: 'bold',
  43. }
  44. },
  45. labelLine: {
  46. show: false
  47. },
  48. data: [
  49. {
  50. value: 200, name: '稼动', itemStyle: {
  51. normal: {
  52. color: `rgb(61,149,73)`
  53. }
  54. }
  55. },
  56. {
  57. value: 100, name: '其它', itemStyle: {
  58. normal: {
  59. color: `rgb(255,255,255)`
  60. }
  61. }
  62. }
  63. ]
  64. },
  65. {
  66. name: '报警',
  67. type: 'pie',
  68. radius: ['50%', '70%'],
  69. center: ['37.5%', '50%'],
  70. avoidLabelOverlap: false,
  71. label: {
  72. show: true,
  73. position: 'center',
  74. fontSize: '16',
  75. fontWeight: 'bold',
  76. formatter: function (param) {
  77. if (param.dataIndex === 0) {
  78. return param.percent + '%\n'
  79. + param.data.value + '台';
  80. }
  81. return '';
  82. }
  83. },
  84. emphasis: {
  85. label: {
  86. show: false,
  87. fontSize: '30',
  88. fontWeight: 'bold'
  89. }
  90. },
  91. labelLine: {
  92. show: false
  93. },
  94. data: [
  95. {
  96. value: 50, name: '报警', itemStyle: {
  97. normal: {
  98. color: `rgb(255,0,0)`
  99. }
  100. }
  101. },
  102. {
  103. value: 200, name: '其它', itemStyle: {
  104. normal: {
  105. color: `rgb(255,255,255)`
  106. }
  107. }
  108. }
  109. ]
  110. },
  111. {
  112. name: '待机',
  113. type: 'pie',
  114. radius: ['50%', '70%'],
  115. center: ['62.5%', '50%'],
  116. avoidLabelOverlap: false,
  117. label: {
  118. show: true,
  119. position: 'center',
  120. fontSize: '16',
  121. fontWeight: 'bold',
  122. formatter: function (param) {
  123. if (param.dataIndex === 0) {
  124. return param.percent + '%\n'
  125. + param.data.value + '台';
  126. }
  127. return '';
  128. }
  129. },
  130. emphasis: {
  131. label: {
  132. show: false,
  133. fontSize: '30',
  134. fontWeight: 'bold'
  135. }
  136. },
  137. labelLine: {
  138. show: false
  139. },
  140. data: [
  141. {
  142. value: 150, name: '待机', itemStyle: {
  143. normal: {
  144. color: `rgb(178,178,0)`
  145. }
  146. }
  147. },
  148. {
  149. value: 200, name: '其它', itemStyle: {
  150. normal: {
  151. color: `rgb(255,255,255)`
  152. }
  153. }
  154. }
  155. ]
  156. },
  157. {
  158. name: '离线',
  159. type: 'pie',
  160. radius: ['50%', '70%'],
  161. center: ['87.5%', '50%'],
  162. avoidLabelOverlap: false,
  163. label: {
  164. show: true,
  165. position: 'center',
  166. fontSize: '16',
  167. fontWeight: 'bold',
  168. formatter: function (param) {
  169. if (param.dataIndex === 0) {
  170. return param.percent + '%\n'
  171. + param.data.value + '台';
  172. }
  173. return '';
  174. }
  175. },
  176. emphasis: {
  177. label: {
  178. show: false,
  179. fontSize: '30',
  180. fontWeight: 'bold'
  181. }
  182. },
  183. labelLine: {
  184. show: false
  185. },
  186. data: [
  187. {
  188. value: 30, name: '离线', itemStyle: {
  189. normal: {
  190. color: `rgb(178,178,178)`
  191. }
  192. }
  193. },
  194. {
  195. value: 400, name: '其它', itemStyle: {
  196. normal: {
  197. color: `rgb(255,255,255)`
  198. }
  199. }
  200. }
  201. ]
  202. }
  203. ]
  204. };
  205. chart.setOption(option);
  206. window.addEventListener("resize", function () {
  207. chart.resize();
  208. });
  209. }
  210. // 保养率图表
  211. function renderPMChart() {
  212. var elementName = 'pmChart';
  213. var chart;
  214. var xdata = ['未来城园区2F', '2园区2F', '3园区2F', '未来城园区1F', '2园区1F', '3园区1F']
  215. var options = {
  216. chart: {
  217. type: 'column',
  218. renderTo: elementName,
  219. // marginBottom: 30,
  220. // marginLeft: 20,
  221. // marginTop: 20,
  222. // marginRight: 20,
  223. margin: 30,
  224. marginBottom: 60,
  225. backgroundColor: 'rgba(0,0,0,0)',
  226. options3d: {
  227. enabled: true,
  228. alpha: 30,
  229. beta: 0,
  230. depth: 70,
  231. viewDistance: 100, // 视图距离,它对于计算角度影响在柱图和散列图非常重要。此值不能用于3D的饼图
  232. frame: { // Frame框架,3D图包含柱的面板,我们以X ,Y,Z的坐标系来理解,X轴与 Z轴所形成
  233. // 的面为bottom,Y轴与Z轴所形成的面为side,X轴与Y轴所形成的面为back,bottom、
  234. // side、back的属性一样,其中size为感官理解的厚度,color为面板颜色
  235. bottom: {
  236. size: 20
  237. },
  238. side: {
  239. size: 1,
  240. color: 'transparent'
  241. },
  242. back: {
  243. size: 1,
  244. color: 'transparent'
  245. }
  246. }
  247. },
  248. },
  249. title: {
  250. text: null
  251. },
  252. plotOptions: {
  253. column: {
  254. depth: 25
  255. }
  256. },
  257. colors: ['#7cb5ec', '#e4d354'],
  258. credits: {
  259. enabled: false
  260. },
  261. legend: {
  262. enabled: false
  263. },
  264. xAxis: {
  265. categories: xdata,
  266. labels: {
  267. style: {
  268. color: '#fff'
  269. }
  270. },
  271. gridLineColor: 'rgba(255,255,255,0.3)'
  272. },
  273. yAxis: {
  274. title: {
  275. text: null
  276. },
  277. labels: {
  278. style: {
  279. color: '#fff'
  280. }
  281. },
  282. gridLineColor: 'rgba(255,255,255,0.3)'
  283. },
  284. series: []
  285. };
  286. var series = [{
  287. name: '已保养',
  288. data: [50, 60, 42, 44, 68, 92],
  289. dataLabels: {
  290. enabled: true,
  291. color: '#FFFFFF',
  292. align: 'center',
  293. formatter: function () {
  294. return this.y;
  295. }
  296. }
  297. }, {
  298. name: '全部',
  299. data: [67, 60, 56, 50, 90, 100],
  300. dataLabels: {
  301. enabled: true,
  302. color: '#FFFFFF',
  303. align: 'center',
  304. formatter: function () {
  305. return this.y;
  306. }
  307. }
  308. }];
  309. options.series = series;
  310. chart = Highcharts.chart(options);
  311. }
  312. // MTBA
  313. function renderMTBAChart() {
  314. var elementName = 'chart_2';
  315. var chart;
  316. var xdata = ['DA', 'WB', 'LHA', 'AA']
  317. var options = {
  318. chart: {
  319. type: 'column',
  320. renderTo: elementName,
  321. // marginBottom: 30,
  322. // marginLeft: 20,
  323. // marginTop: 20,
  324. // marginRight: 20,
  325. margin: 30,
  326. marginBottom: 60,
  327. backgroundColor: 'rgba(0,0,0,0)',
  328. options3d: {
  329. enabled: true,
  330. alpha: 30,
  331. beta: 0,
  332. depth: 70,
  333. viewDistance: 100, // 视图距离,它对于计算角度影响在柱图和散列图非常重要。此值不能用于3D的饼图
  334. frame: { // Frame框架,3D图包含柱的面板,我们以X ,Y,Z的坐标系来理解,X轴与 Z轴所形成
  335. // 的面为bottom,Y轴与Z轴所形成的面为side,X轴与Y轴所形成的面为back,bottom、
  336. // side、back的属性一样,其中size为感官理解的厚度,color为面板颜色
  337. bottom: {
  338. size: 20
  339. },
  340. side: {
  341. size: 1,
  342. color: 'transparent'
  343. },
  344. back: {
  345. size: 1,
  346. color: 'transparent'
  347. }
  348. }
  349. },
  350. },
  351. title: {
  352. text: null
  353. },
  354. plotOptions: {
  355. column: {
  356. depth: 25
  357. }
  358. },
  359. colors: ['#AAEEEE'],
  360. credits: {
  361. enabled: false
  362. },
  363. legend: {
  364. enabled: false
  365. },
  366. xAxis: {
  367. categories: xdata,
  368. labels: {
  369. style: {
  370. color: '#fff'
  371. }
  372. },
  373. gridLineColor: 'rgba(255,255,255,0.3)'
  374. },
  375. yAxis: {
  376. title: {
  377. text: null
  378. },
  379. labels: {
  380. style: {
  381. color: '#fff'
  382. }
  383. },
  384. gridLineColor: 'rgba(255,255,255,0.3)'
  385. },
  386. series: []
  387. };
  388. var series = [{
  389. name: 'MTBA',
  390. data: [10.2, 8.6, 22.3, 32.2],
  391. dataLabels: {
  392. enabled: true,
  393. color: '#FFFFFF',
  394. align: 'center',
  395. formatter: function () {
  396. return this.y;
  397. }
  398. }
  399. }];
  400. options.series = series;
  401. chart = Highcharts.chart(options);
  402. }
  403. // 各车间设备数量
  404. function renderEquipmentChart() {
  405. var elementName = 'chart_1';
  406. var chart;
  407. var xdata = ['车间1', '车间2', '车间3', '车间4', '车间5', '车间6']
  408. var options = {
  409. chart: {
  410. type: 'column',
  411. renderTo: elementName,
  412. // marginBottom: 30,
  413. // marginLeft: 20,
  414. // marginTop: 20,
  415. // marginRight: 20,
  416. margin: 30,
  417. marginBottom: 60,
  418. backgroundColor: 'rgba(0,0,0,0)',
  419. options3d: {
  420. enabled: true,
  421. alpha: 30,
  422. beta: 0,
  423. depth: 70,
  424. viewDistance: 100, // 视图距离,它对于计算角度影响在柱图和散列图非常重要。此值不能用于3D的饼图
  425. frame: { // Frame框架,3D图包含柱的面板,我们以X ,Y,Z的坐标系来理解,X轴与 Z轴所形成
  426. // 的面为bottom,Y轴与Z轴所形成的面为side,X轴与Y轴所形成的面为back,bottom、
  427. // side、back的属性一样,其中size为感官理解的厚度,color为面板颜色
  428. bottom: {
  429. size: 20
  430. },
  431. side: {
  432. size: 1,
  433. color: 'transparent'
  434. },
  435. back: {
  436. size: 1,
  437. color: 'transparent'
  438. }
  439. }
  440. },
  441. },
  442. title: {
  443. text: null
  444. },
  445. plotOptions: {
  446. column: {
  447. depth: 25
  448. }
  449. },
  450. colors: ['#44A9A8'],
  451. credits: {
  452. enabled: false
  453. },
  454. legend: {
  455. enabled: false
  456. },
  457. xAxis: {
  458. categories: xdata,
  459. labels: {
  460. style: {
  461. color: '#fff'
  462. }
  463. },
  464. gridLineColor: 'rgba(255,255,255,0.3)'
  465. },
  466. yAxis: {
  467. title: {
  468. text: null
  469. },
  470. labels: {
  471. style: {
  472. color: '#fff'
  473. }
  474. },
  475. gridLineColor: 'rgba(255,255,255,0.3)'
  476. },
  477. series: []
  478. };
  479. var series = [{
  480. name: '数量',
  481. data: [100, 120, 88, 124, 78, 92],
  482. dataLabels: {
  483. enabled: true,
  484. color: '#FFFFFF',
  485. align: 'center',
  486. formatter: function () {
  487. return this.y;
  488. }
  489. }
  490. }];
  491. options.series = series;
  492. chart = Highcharts.chart(options);
  493. }
  494. // 报警TOP5
  495. function renderAlarmChart() {
  496. var elementName = 'alarmChart';
  497. var chart;
  498. var xdata = ['车间1', '车间2', '车间3', '车间4', '车间5', '车间6']
  499. var options = {
  500. chart: {
  501. type: 'column',
  502. renderTo: elementName,
  503. // marginBottom: 30,
  504. // marginLeft: 20,
  505. // marginTop: 20,
  506. // marginRight: 20,
  507. margin: 30,
  508. marginBottom: 60,
  509. backgroundColor: 'rgba(0,0,0,0)',
  510. options3d: {
  511. enabled: true,
  512. alpha: 30,
  513. beta: 0,
  514. depth: 70,
  515. viewDistance: 100, // 视图距离,它对于计算角度影响在柱图和散列图非常重要。此值不能用于3D的饼图
  516. frame: { // Frame框架,3D图包含柱的面板,我们以X ,Y,Z的坐标系来理解,X轴与 Z轴所形成
  517. // 的面为bottom,Y轴与Z轴所形成的面为side,X轴与Y轴所形成的面为back,bottom、
  518. // side、back的属性一样,其中size为感官理解的厚度,color为面板颜色
  519. bottom: {
  520. size: 20
  521. },
  522. side: {
  523. size: 1,
  524. color: 'transparent'
  525. },
  526. back: {
  527. size: 1,
  528. color: 'transparent'
  529. }
  530. }
  531. },
  532. },
  533. title: {
  534. text: null
  535. },
  536. plotOptions: {
  537. column: {
  538. depth: 25
  539. }
  540. },
  541. colors: ['#FF0000'],
  542. credits: {
  543. enabled: false
  544. },
  545. legend: {
  546. enabled: false
  547. },
  548. xAxis: {
  549. categories: xdata,
  550. labels: {
  551. style: {
  552. color: '#fff'
  553. }
  554. },
  555. gridLineColor: 'rgba(255,255,255,0.3)'
  556. },
  557. yAxis: {
  558. title: {
  559. text: null
  560. },
  561. labels: {
  562. style: {
  563. color: '#fff'
  564. }
  565. },
  566. gridLineColor: 'rgba(255,255,255,0.3)'
  567. },
  568. series: []
  569. };
  570. var series = [{
  571. name: '数量',
  572. data: [100, 120, 88, 124, 78, 92],
  573. dataLabels: {
  574. enabled: true,
  575. color: '#FFFFFF',
  576. align: 'center',
  577. formatter: function () {
  578. return this.y;
  579. }
  580. }
  581. }];
  582. options.series = series;
  583. chart = Highcharts.chart(options);
  584. }
  585. // 保养费用
  586. function renderPmCharge() {
  587. var chart = Highcharts.chart('chargeChart', {
  588. chart: {
  589. type: 'pie',
  590. backgroundColor: 'rgba(0,0,0,0)',
  591. options3d: {
  592. enabled: true,
  593. alpha: 45,
  594. beta: 0
  595. }
  596. },
  597. title: {
  598. text: null
  599. },
  600. tooltip: {
  601. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  602. },
  603. credits: {
  604. enabled: false
  605. },
  606. legend: {
  607. enabled: false
  608. },
  609. plotOptions: {
  610. pie: {
  611. allowPointSelect: true,
  612. cursor: 'pointer',
  613. depth: 35,
  614. dataLabels: {
  615. enabled: true,
  616. format: '{point.name}'
  617. }
  618. }
  619. },
  620. series: [{
  621. type: 'pie',
  622. name: '各园区费用占比',
  623. data: [
  624. { name: '2号园区', y: 100,drilldown: '2号园区'},
  625. {name: '3号园区', y: 120, drilldown: '3号园区'},
  626. {
  627. name: '未来城园区',
  628. y: 230,
  629. drilldown:'未来城园区'
  630. }
  631. ],
  632. dataLabels: {
  633. distance: 5
  634. }
  635. }],
  636. drilldown: {
  637. series: [{
  638. type: 'pie',
  639. name: '2号园区',
  640. data: [
  641. ['车间1', 30],
  642. ['车间2', 50],
  643. {
  644. name: '车间3',
  645. y: 20,
  646. }, {
  647. name: '车间4',
  648. y: 25
  649. }
  650. ]
  651. },
  652. {
  653. type: 'pie',
  654. name: '3号园区',
  655. data: [
  656. ['车间1', 30],
  657. ['车间2', 50],
  658. {
  659. name: '车间3',
  660. y: 20,
  661. }, {
  662. name: '车间4',
  663. y: 25
  664. }
  665. ]
  666. },
  667. {
  668. type: 'pie',
  669. name: '未来城园区',
  670. data: [
  671. ['车间1', 30],
  672. ['车间2', 50],
  673. {
  674. name: '车间3',
  675. y: 20,
  676. }, {
  677. name: '车间4',
  678. y: 25
  679. }
  680. ]
  681. }
  682. ]
  683. }
  684. });
  685. }
  686. //echart_3货物周转量
  687. function echart_3() {
  688. // 基于准备好的dom,初始化echarts实例
  689. var myChart = echarts.init(document.getElementById('chart_3'));
  690. myChart.clear();
  691. option = {
  692. title: {
  693. text: ''
  694. },
  695. tooltip: {
  696. trigger: 'axis'
  697. },
  698. legend: {
  699. data: ['DA', 'WB', 'LHA', 'AA'],
  700. textStyle: {
  701. color: '#fff'
  702. },
  703. top: '8%'
  704. },
  705. grid: {
  706. top: '23%',
  707. left: '3%',
  708. right: '7%',
  709. bottom: '8%',
  710. containLabel: true
  711. },
  712. color: ['#FF4949', '#FFA74D', '#FFEA51', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'],
  713. xAxis: {
  714. type: 'category',
  715. boundaryGap: false,
  716. data: ['8:00', '9:00', '10:00', '11:00', '12:00'],
  717. splitLine: {
  718. show: false
  719. },
  720. axisLine: {
  721. lineStyle: {
  722. color: '#fff'
  723. }
  724. }
  725. },
  726. yAxis: {
  727. type: 'value',
  728. splitLine: {
  729. show: false
  730. },
  731. axisLine: {
  732. lineStyle: {
  733. color: '#fff'
  734. }
  735. }
  736. },
  737. series: [
  738. {
  739. name: 'DA',
  740. type: 'line',
  741. data: [3961.88, 4233.63, 4183.14, 3633.01, 3704.47]
  742. },
  743. {
  744. name: 'WB',
  745. type: 'line',
  746. data: [3374.76, 3364.76, 3274.76, 3371.82, 3259.87]
  747. },
  748. {
  749. name: 'LHA',
  750. type: 'line',
  751. data: [14.77, 15.17, 13.17, 14.56, 15.84]
  752. },
  753. {
  754. name: 'AA',
  755. type: 'line',
  756. data: [686.17, 847.26, 895.22, 865.28, 886.72]
  757. }
  758. ]
  759. };
  760. myChart.setOption(option);
  761. }
  762. //湖南高速公路
  763. function echart_4() {
  764. // 基于准备好的dom,初始化echarts实例
  765. var myChart = echarts.init(document.getElementById('chart_4'));
  766. option = {
  767. title: {
  768. text: '南丁格尔玫瑰图',
  769. subtext: '纯属虚构',
  770. left: 'center',
  771. show: false
  772. },
  773. tooltip: {
  774. trigger: 'item',
  775. formatter: '{a} <br/>{b} : {c} ({d}%)'
  776. },
  777. legend: {
  778. left: 'center',
  779. top: 'bottom',
  780. data: ['费用1', '费用2', '费用3', '费用4', '费用5', '费用6', '费用7', '费用8'],
  781. show: false
  782. },
  783. series: [
  784. {
  785. name: '面积模式',
  786. type: 'pie',
  787. radius: [30, 90],
  788. center: ['50%', '50%'],
  789. roseType: 'area',
  790. data: [
  791. { value: 10, name: '费用1' },
  792. { value: 5, name: '费用2' },
  793. { value: 15, name: '费用3' },
  794. { value: 25, name: '费用4' },
  795. { value: 20, name: '费用5' },
  796. { value: 35, name: '费用6' },
  797. { value: 30, name: '费用7' },
  798. { value: 40, name: '费用8' }
  799. ]
  800. }
  801. ]
  802. };
  803. myChart.setOption(option);
  804. // 使用刚指定的配置项和数据显示图表。
  805. window.addEventListener("resize", function () {
  806. myChart.resize();
  807. });
  808. }
  809. //报警TOP5
  810. function echart_5() {
  811. // 基于准备好的dom,初始化echarts实例
  812. var myChart = echarts.init(document.getElementById('chart_5'));
  813. function showProvince() {
  814. var option = {
  815. color: ['#3398DB'],
  816. legend: {
  817. top: "0%",
  818. textStyle: {
  819. color: "rgba(255,255,255,0.9)"//图例文字
  820. },
  821. show: false
  822. },
  823. xAxis: {
  824. type: 'category',
  825. data: ['车间1', '车间5', '车间2', '车间3', '车间6'],
  826. axisLine: { lineStyle: { color: "rgba(255,255,255,.1)" } },
  827. axisLabel: {
  828. textStyle: { color: "rgba(255,255,255,1)", fontSize: '14', },
  829. },
  830. },
  831. yAxis: {
  832. type: 'value',
  833. axisLabel: {
  834. textStyle: { color: "rgba(255,255,255,1)", fontSize: '14', },
  835. },
  836. },
  837. series: [{
  838. data: [10, 15, 8, 7.2, 6.3],
  839. type: 'bar',
  840. label: {
  841. show: true,
  842. color: '#fff',
  843. formatter: '{c}%'
  844. }
  845. }]
  846. };
  847. myChart.setOption(option);
  848. }
  849. showProvince();
  850. // 使用刚指定的配置项和数据显示图表。
  851. // myChart.setOption(option);
  852. window.addEventListener("resize", function () {
  853. myChart.resize();
  854. });
  855. }
  856. //#region 点击跳转
  857. // $('#chart_map').click(function () {
  858. // window.location.href = './page/index.html';
  859. // });
  860. // $('.t_btn2').click(function () {
  861. // window.location.href = "./page/index.html?id=2";
  862. // });
  863. // $('.t_btn3').click(function () {
  864. // window.location.href = "./page/index.html?id=3";
  865. // });
  866. // $('.t_btn4').click(function () {
  867. // window.location.href = "./page/index.html?id=4";
  868. // });
  869. // $('.t_btn5').click(function () {
  870. // window.location.href = "./page/index.html?id=5";
  871. // });
  872. // $('.t_btn6').click(function () {
  873. // window.location.href = "./page/index.html?id=6";
  874. // });
  875. // $('.t_btn7').click(function () {
  876. // window.location.href = "./page/index.html?id=7";
  877. // });
  878. // $('.t_btn8').click(function () {
  879. // window.location.href = "./page/index.html?id=8";
  880. // });
  881. // $('.t_btn9').click(function () {
  882. // window.location.href = "./page/index.html?id=9";
  883. // });
  884. //#endregion
  885. });