visualization-dashboard.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" class="iframe-content">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>可视化统计大屏 - 爱智农</title>
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
  8. <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
  9. <style>
  10. body {
  11. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  12. background-color: #001529;
  13. color: #fff;
  14. margin: 0;
  15. padding: 0;
  16. overflow-x: hidden;
  17. }
  18. .dashboard-container {
  19. padding: 20px;
  20. min-height: 100vh; width: 100%; max-width: 100%; box-sizing: border-box;
  21. }
  22. .dashboard-header {
  23. text-align: center;
  24. margin-bottom: 30px;
  25. position: relative;
  26. }
  27. .dashboard-title {
  28. font-size: 36px;
  29. font-weight: bold;
  30. background: linear-gradient(90deg, #4CAF50, #8BC34A, #CDDC39);
  31. -webkit-background-clip: text;
  32. -webkit-text-fill-color: transparent;
  33. position: relative;
  34. display: inline-block;
  35. padding: 0 50px;
  36. }
  37. .dashboard-title::before,
  38. .dashboard-title::after {
  39. content: "";
  40. position: absolute;
  41. top: 50%;
  42. width: 40px;
  43. height: 2px;
  44. background: linear-gradient(90deg, #4CAF50, #8BC34A);
  45. }
  46. .dashboard-title::before {
  47. left: 0;
  48. }
  49. .dashboard-title::after {
  50. right: 0;
  51. }
  52. .card {
  53. background: rgba(16, 36, 64, 0.8);
  54. border-radius: 8px;
  55. box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
  56. padding: 20px;
  57. position: relative;
  58. overflow: hidden;
  59. height: 100%;
  60. }
  61. .card::before {
  62. content: "";
  63. position: absolute;
  64. top: 0;
  65. left: 0;
  66. right: 0;
  67. height: 2px;
  68. background: linear-gradient(90deg, #4CAF50, #8BC34A);
  69. }
  70. .card-title {
  71. font-size: 18px;
  72. font-weight: bold;
  73. margin-bottom: 20px;
  74. color: #4CAF50;
  75. display: flex;
  76. align-items: center;
  77. }
  78. .card-title::before {
  79. content: "";
  80. display: block;
  81. width: 4px;
  82. height: 16px;
  83. background: #4CAF50;
  84. margin-right: 8px;
  85. border-radius: 2px;
  86. }
  87. .chart-container {
  88. height: 300px;
  89. width: 100%;
  90. }
  91. .number-card {
  92. text-align: center;
  93. padding: 20px;
  94. }
  95. .number-value {
  96. font-size: 36px;
  97. font-weight: bold;
  98. margin-bottom: 5px;
  99. background: linear-gradient(90deg, #4CAF50, #8BC34A);
  100. -webkit-background-clip: text;
  101. -webkit-text-fill-color: transparent;
  102. }
  103. .number-label {
  104. font-size: 14px;
  105. color: #aaa;
  106. }
  107. .grid-bg {
  108. position: fixed;
  109. top: 0;
  110. left: 0;
  111. width: 100%;
  112. height: 100%;
  113. background-image:
  114. linear-gradient(rgba(76, 175, 80, 0.05) 1px, transparent 1px),
  115. linear-gradient(90deg, rgba(76, 175, 80, 0.05) 1px, transparent 1px);
  116. background-size: 20px 20px;
  117. z-index: -1;
  118. }
  119. .map-container {
  120. height: 400px;
  121. position: relative;
  122. }
  123. .map-overlay {
  124. position: absolute;
  125. top: 20px;
  126. right: 20px;
  127. background: rgba(16, 36, 64, 0.9);
  128. padding: 10px;
  129. border-radius: 4px;
  130. z-index: 10;
  131. }
  132. .map-legend {
  133. display: flex;
  134. align-items: center;
  135. margin-bottom: 5px;
  136. }
  137. .map-legend-color {
  138. width: 12px;
  139. height: 12px;
  140. margin-right: 5px;
  141. border-radius: 2px;
  142. }
  143. .progress-container {
  144. margin-bottom: 15px;
  145. }
  146. .progress-label {
  147. display: flex;
  148. justify-content: space-between;
  149. margin-bottom: 5px;
  150. }
  151. .progress-bar {
  152. height: 8px;
  153. border-radius: 4px;
  154. background: rgba(255, 255, 255, 0.1);
  155. overflow: hidden;
  156. }
  157. .progress-fill {
  158. height: 100%;
  159. border-radius: 4px;
  160. background: linear-gradient(90deg, #4CAF50, #8BC34A);
  161. }
  162. .device-status {
  163. display: flex;
  164. align-items: center;
  165. margin-bottom: 10px;
  166. }
  167. .status-dot {
  168. width: 10px;
  169. height: 10px;
  170. border-radius: 50%;
  171. margin-right: 8px;
  172. }
  173. .status-online {
  174. background-color: #4CAF50;
  175. }
  176. .status-offline {
  177. background-color: #F44336;
  178. }
  179. .status-warning {
  180. background-color: #FF9800;
  181. }
  182. .clock {
  183. font-size: 18px;
  184. color: #8BC34A;
  185. margin-bottom: 10px;
  186. text-align: center;
  187. }
  188. @keyframes pulse {
  189. 0% { transform: scale(1); }
  190. 50% { transform: scale(1.05); }
  191. 100% { transform: scale(1); }
  192. }
  193. .pulse-animation {
  194. animation: pulse 2s infinite;
  195. }
  196. </style>
  197. </head>
  198. <body>
  199. <div class="grid-bg"></div>
  200. <div class="dashboard-container">
  201. <header class="dashboard-header">
  202. <h1 class="dashboard-title">智慧农业数据可视化平台</h1>
  203. <div class="clock" id="dashboard-clock"></div>
  204. </header>
  205. <div class="grid grid-cols-4 gap-6 mb-6">
  206. <div class="number-card card">
  207. <div class="number-value pulse-animation">2,560</div>
  208. <div class="number-label">农业总面积(亩)</div>
  209. </div>
  210. <div class="number-card card">
  211. <div class="number-value pulse-animation">1,850</div>
  212. <div class="number-label">年产量(吨)</div>
  213. </div>
  214. <div class="number-card card">
  215. <div class="number-value pulse-animation">86%</div>
  216. <div class="number-label">设备在线率</div>
  217. </div>
  218. <div class="number-card card">
  219. <div class="number-value pulse-animation">12</div>
  220. <div class="number-label">智能农机设备(台)</div>
  221. </div>
  222. </div>
  223. <div class="grid grid-cols-2 gap-6 mb-6">
  224. <div class="card">
  225. <h3 class="card-title">农作物分布</h3>
  226. <div id="cropDistribution" class="chart-container"></div>
  227. </div>
  228. <div class="card">
  229. <h3 class="card-title">年度产量趋势</h3>
  230. <div id="yieldTrend" class="chart-container"></div>
  231. </div>
  232. </div>
  233. <div class="grid grid-cols-1 gap-6 mb-6">
  234. <div class="card">
  235. <h3 class="card-title">区域分布地图</h3>
  236. <div class="map-container">
  237. <div id="regionMap" class="chart-container" style="height: 100%;"></div>
  238. <div class="map-overlay">
  239. <div class="map-legend">
  240. <div class="map-legend-color" style="background-color: rgba(76, 175, 80, 0.8);"></div>
  241. <div>农田区域</div>
  242. </div>
  243. <div class="map-legend">
  244. <div class="map-legend-color" style="background-color: rgba(33, 150, 243, 0.8);"></div>
  245. <div>水源区域</div>
  246. </div>
  247. <div class="map-legend">
  248. <div class="map-legend-color" style="background-color: rgba(255, 152, 0, 0.8);"></div>
  249. <div>设施区域</div>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="grid grid-cols-3 gap-6 mb-6">
  256. <div class="card">
  257. <h3 class="card-title">农事进展</h3>
  258. <div class="progress-container">
  259. <div class="progress-label">
  260. <span>水稻种植</span>
  261. <span>75%</span>
  262. </div>
  263. <div class="progress-bar">
  264. <div class="progress-fill" style="width: 75%;"></div>
  265. </div>
  266. </div>
  267. <div class="progress-container">
  268. <div class="progress-label">
  269. <span>小麦收割</span>
  270. <span>90%</span>
  271. </div>
  272. <div class="progress-bar">
  273. <div class="progress-fill" style="width: 90%;"></div>
  274. </div>
  275. </div>
  276. <div class="progress-container">
  277. <div class="progress-label">
  278. <span>玉米播种</span>
  279. <span>45%</span>
  280. </div>
  281. <div class="progress-bar">
  282. <div class="progress-fill" style="width: 45%;"></div>
  283. </div>
  284. </div>
  285. <div class="progress-container">
  286. <div class="progress-label">
  287. <span>果树修剪</span>
  288. <span>60%</span>
  289. </div>
  290. <div class="progress-bar">
  291. <div class="progress-fill" style="width: 60%;"></div>
  292. </div>
  293. </div>
  294. <div class="progress-container">
  295. <div class="progress-label">
  296. <span>蔬菜采收</span>
  297. <span>80%</span>
  298. </div>
  299. <div class="progress-bar">
  300. <div class="progress-fill" style="width: 80%;"></div>
  301. </div>
  302. </div>
  303. </div>
  304. <div class="card">
  305. <h3 class="card-title">设备在线状态</h3>
  306. <div id="deviceStatus" class="chart-container"></div>
  307. </div>
  308. <div class="card">
  309. <h3 class="card-title">农业资源消耗</h3>
  310. <div id="resourceUsage" class="chart-container"></div>
  311. </div>
  312. </div>
  313. <div class="grid grid-cols-2 gap-6">
  314. <div class="card">
  315. <h3 class="card-title">气象数据监测</h3>
  316. <div id="weatherMonitor" class="chart-container"></div>
  317. </div>
  318. <div class="card">
  319. <h3 class="card-title">智能设备分布</h3>
  320. <div id="deviceDistribution" class="chart-container"></div>
  321. </div>
  322. </div>
  323. </div>
  324. <script>
  325. // 设置当前时间
  326. function updateClock() {
  327. const now = new Date();
  328. const options = {
  329. year: 'numeric',
  330. month: 'long',
  331. day: 'numeric',
  332. weekday: 'long',
  333. hour: '2-digit',
  334. minute: '2-digit',
  335. second: '2-digit'
  336. };
  337. document.getElementById('dashboard-clock').textContent = now.toLocaleDateString('zh-CN', options);
  338. }
  339. updateClock();
  340. setInterval(updateClock, 1000);
  341. // 作物分布饼图
  342. const cropDistributionChart = echarts.init(document.getElementById('cropDistribution'));
  343. cropDistributionChart.setOption({
  344. tooltip: {
  345. trigger: 'item',
  346. formatter: '{a} <br/>{b}: {c} ({d}%)'
  347. },
  348. legend: {
  349. orient: 'vertical',
  350. right: 10,
  351. top: 'center',
  352. textStyle: {
  353. color: '#fff'
  354. },
  355. data: ['水稻', '小麦', '玉米', '蔬菜', '果树', '其他']
  356. },
  357. series: [
  358. {
  359. name: '作物分布',
  360. type: 'pie',
  361. radius: ['40%', '70%'],
  362. avoidLabelOverlap: false,
  363. itemStyle: {
  364. borderRadius: 10,
  365. borderColor: '#001529',
  366. borderWidth: 2
  367. },
  368. label: {
  369. show: false,
  370. position: 'center'
  371. },
  372. emphasis: {
  373. label: {
  374. show: true,
  375. fontSize: '18',
  376. fontWeight: 'bold'
  377. }
  378. },
  379. labelLine: {
  380. show: false
  381. },
  382. data: [
  383. { value: 1048, name: '水稻' },
  384. { value: 735, name: '小麦' },
  385. { value: 580, name: '玉米' },
  386. { value: 484, name: '蔬菜' },
  387. { value: 300, name: '果树' },
  388. { value: 200, name: '其他' }
  389. ],
  390. color: ['#4CAF50', '#8BC34A', '#CDDC39', '#FFC107', '#FF9800', '#FF5722']
  391. }
  392. ]
  393. });
  394. // 年度产量趋势
  395. const yieldTrendChart = echarts.init(document.getElementById('yieldTrend'));
  396. yieldTrendChart.setOption({
  397. tooltip: {
  398. trigger: 'axis'
  399. },
  400. legend: {
  401. data: ['去年产量', '今年产量'],
  402. textStyle: {
  403. color: '#fff'
  404. }
  405. },
  406. grid: {
  407. left: '3%',
  408. right: '4%',
  409. bottom: '3%',
  410. containLabel: true
  411. },
  412. xAxis: {
  413. type: 'category',
  414. boundaryGap: false,
  415. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  416. axisLine: {
  417. lineStyle: {
  418. color: '#aaa'
  419. }
  420. },
  421. axisLabel: {
  422. color: '#aaa'
  423. }
  424. },
  425. yAxis: {
  426. type: 'value',
  427. axisLine: {
  428. lineStyle: {
  429. color: '#aaa'
  430. }
  431. },
  432. axisLabel: {
  433. color: '#aaa'
  434. },
  435. splitLine: {
  436. lineStyle: {
  437. color: 'rgba(255,255,255,0.1)'
  438. }
  439. }
  440. },
  441. series: [
  442. {
  443. name: '去年产量',
  444. type: 'line',
  445. stack: 'Total',
  446. data: [120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330],
  447. smooth: true,
  448. lineStyle: {
  449. width: 0
  450. },
  451. showSymbol: false,
  452. areaStyle: {
  453. opacity: 0.8,
  454. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  455. {
  456. offset: 0,
  457. color: 'rgba(128, 255, 165, 0.7)'
  458. },
  459. {
  460. offset: 1,
  461. color: 'rgba(1, 191, 236, 0.1)'
  462. }
  463. ])
  464. },
  465. emphasis: {
  466. focus: 'series'
  467. }
  468. },
  469. {
  470. name: '今年产量',
  471. type: 'line',
  472. stack: 'Total',
  473. data: [150, 232, 201, 154, 190, 330, 410, 332, 301, 334, 390, 330],
  474. smooth: true,
  475. lineStyle: {
  476. width: 0
  477. },
  478. showSymbol: false,
  479. areaStyle: {
  480. opacity: 0.8,
  481. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  482. {
  483. offset: 0,
  484. color: 'rgba(0, 221, 255, 0.7)'
  485. },
  486. {
  487. offset: 1,
  488. color: 'rgba(77, 119, 255, 0.1)'
  489. }
  490. ])
  491. },
  492. emphasis: {
  493. focus: 'series'
  494. }
  495. }
  496. ]
  497. });
  498. // 区域分布地图
  499. const regionMapChart = echarts.init(document.getElementById('regionMap'));
  500. regionMapChart.setOption({
  501. geo: {
  502. map: 'china',
  503. roam: true,
  504. label: {
  505. emphasis: {
  506. show: false
  507. }
  508. },
  509. itemStyle: {
  510. normal: {
  511. areaColor: '#323c48',
  512. borderColor: '#111'
  513. },
  514. emphasis: {
  515. areaColor: '#2a333d'
  516. }
  517. }
  518. },
  519. series: [
  520. {
  521. name: '农田分布',
  522. type: 'scatter',
  523. coordinateSystem: 'geo',
  524. data: [
  525. {name: '北京', value: [116.46, 39.92, 100]},
  526. {name: '上海', value: [121.48, 31.22, 80]},
  527. {name: '广州', value: [113.23, 23.16, 70]},
  528. {name: '深圳', value: [114.07, 22.62, 60]},
  529. {name: '杭州', value: [120.19, 30.26, 90]},
  530. {name: '西安', value: [108.95, 34.27, 50]},
  531. {name: '成都', value: [104.06, 30.67, 85]}
  532. ],
  533. symbolSize: function (val) {
  534. return val[2] / 10;
  535. },
  536. label: {
  537. formatter: '{b}',
  538. position: 'right',
  539. show: false
  540. },
  541. itemStyle: {
  542. color: '#4CAF50'
  543. },
  544. emphasis: {
  545. label: {
  546. show: true
  547. }
  548. }
  549. }
  550. ]
  551. });
  552. // 设备在线状态
  553. const deviceStatusChart = echarts.init(document.getElementById('deviceStatus'));
  554. deviceStatusChart.setOption({
  555. tooltip: {
  556. trigger: 'item'
  557. },
  558. legend: {
  559. top: '5%',
  560. left: 'center',
  561. textStyle: {
  562. color: '#fff'
  563. }
  564. },
  565. series: [
  566. {
  567. name: '设备状态',
  568. type: 'pie',
  569. radius: ['40%', '70%'],
  570. avoidLabelOverlap: false,
  571. itemStyle: {
  572. borderRadius: 10,
  573. borderColor: '#001529',
  574. borderWidth: 2
  575. },
  576. label: {
  577. show: false,
  578. position: 'center'
  579. },
  580. emphasis: {
  581. label: {
  582. show: true,
  583. fontSize: '18',
  584. fontWeight: 'bold'
  585. }
  586. },
  587. labelLine: {
  588. show: false
  589. },
  590. data: [
  591. { value: 86, name: '在线', itemStyle: { color: '#4CAF50' } },
  592. { value: 8, name: '离线', itemStyle: { color: '#F44336' } },
  593. { value: 6, name: '维护中', itemStyle: { color: '#FF9800' } }
  594. ]
  595. }
  596. ]
  597. });
  598. // 农业资源消耗
  599. const resourceUsageChart = echarts.init(document.getElementById('resourceUsage'));
  600. resourceUsageChart.setOption({
  601. tooltip: {
  602. trigger: 'axis',
  603. axisPointer: {
  604. type: 'shadow'
  605. }
  606. },
  607. legend: {
  608. data: ['水资源', '肥料', '农药', '能源'],
  609. textStyle: {
  610. color: '#fff'
  611. }
  612. },
  613. grid: {
  614. left: '3%',
  615. right: '4%',
  616. bottom: '3%',
  617. containLabel: true
  618. },
  619. xAxis: {
  620. type: 'value',
  621. axisLine: {
  622. lineStyle: {
  623. color: '#aaa'
  624. }
  625. },
  626. axisLabel: {
  627. color: '#aaa'
  628. },
  629. splitLine: {
  630. lineStyle: {
  631. color: 'rgba(255,255,255,0.1)'
  632. }
  633. }
  634. },
  635. yAxis: {
  636. type: 'category',
  637. data: ['一季度', '二季度', '三季度', '四季度'],
  638. axisLine: {
  639. lineStyle: {
  640. color: '#aaa'
  641. }
  642. },
  643. axisLabel: {
  644. color: '#aaa'
  645. }
  646. },
  647. series: [
  648. {
  649. name: '水资源',
  650. type: 'bar',
  651. stack: 'total',
  652. label: {
  653. show: true
  654. },
  655. emphasis: {
  656. focus: 'series'
  657. },
  658. data: [320, 302, 301, 334],
  659. color: '#2196F3'
  660. },
  661. {
  662. name: '肥料',
  663. type: 'bar',
  664. stack: 'total',
  665. label: {
  666. show: true
  667. },
  668. emphasis: {
  669. focus: 'series'
  670. },
  671. data: [120, 132, 101, 134],
  672. color: '#4CAF50'
  673. },
  674. {
  675. name: '农药',
  676. type: 'bar',
  677. stack: 'total',
  678. label: {
  679. show: true
  680. },
  681. emphasis: {
  682. focus: 'series'
  683. },
  684. data: [220, 182, 191, 234],
  685. color: '#FF9800'
  686. },
  687. {
  688. name: '能源',
  689. type: 'bar',
  690. stack: 'total',
  691. label: {
  692. show: true
  693. },
  694. emphasis: {
  695. focus: 'series'
  696. },
  697. data: [150, 212, 201, 154],
  698. color: '#9C27B0'
  699. }
  700. ]
  701. });
  702. // 气象数据监测
  703. const weatherMonitorChart = echarts.init(document.getElementById('weatherMonitor'));
  704. weatherMonitorChart.setOption({
  705. tooltip: {
  706. trigger: 'axis'
  707. },
  708. legend: {
  709. data: ['温度', '湿度', '降水量'],
  710. textStyle: {
  711. color: '#fff'
  712. }
  713. },
  714. grid: {
  715. left: '3%',
  716. right: '4%',
  717. bottom: '3%',
  718. containLabel: true
  719. },
  720. xAxis: {
  721. type: 'category',
  722. boundaryGap: false,
  723. data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
  724. axisLine: {
  725. lineStyle: {
  726. color: '#aaa'
  727. }
  728. },
  729. axisLabel: {
  730. color: '#aaa'
  731. }
  732. },
  733. yAxis: {
  734. type: 'value',
  735. axisLine: {
  736. lineStyle: {
  737. color: '#aaa'
  738. }
  739. },
  740. axisLabel: {
  741. color: '#aaa'
  742. },
  743. splitLine: {
  744. lineStyle: {
  745. color: 'rgba(255,255,255,0.1)'
  746. }
  747. }
  748. },
  749. series: [
  750. {
  751. name: '温度',
  752. type: 'line',
  753. data: [22, 24, 26, 25, 23, 22, 21],
  754. color: '#FF5722'
  755. },
  756. {
  757. name: '湿度',
  758. type: 'line',
  759. data: [65, 60, 55, 58, 62, 68, 70],
  760. color: '#2196F3'
  761. },
  762. {
  763. name: '降水量',
  764. type: 'line',
  765. data: [0, 0, 5, 10, 2, 0, 0],
  766. color: '#00BCD4'
  767. }
  768. ]
  769. });
  770. // 智能设备分布
  771. const deviceDistributionChart = echarts.init(document.getElementById('deviceDistribution'));
  772. deviceDistributionChart.setOption({
  773. tooltip: {
  774. trigger: 'item'
  775. },
  776. legend: {
  777. top: '5%',
  778. left: 'center',
  779. textStyle: {
  780. color: '#fff'
  781. }
  782. },
  783. series: [
  784. {
  785. name: '设备类型',
  786. type: 'pie',
  787. radius: ['30%', '70%'],
  788. roseType: 'area',
  789. itemStyle: {
  790. borderRadius: 8
  791. },
  792. data: [
  793. { value: 30, name: '气象站', itemStyle: { color: '#2196F3' } },
  794. { value: 28, name: '摄像头', itemStyle: { color: '#4CAF50' } },
  795. { value: 26, name: '土壤传感器', itemStyle: { color: '#FF9800' } },
  796. { value: 24, name: '水质监测', itemStyle: { color: '#00BCD4' } },
  797. { value: 22, name: '自动灌溉', itemStyle: { color: '#9C27B0' } },
  798. { value: 20, name: '无人机', itemStyle: { color: '#F44336' } }
  799. ],
  800. label: {
  801. color: '#fff'
  802. },
  803. labelLine: {
  804. lineStyle: {
  805. color: 'rgba(255, 255, 255, 0.3)'
  806. },
  807. smooth: 0.2,
  808. length: 10,
  809. length2: 20
  810. }
  811. }
  812. ]
  813. });
  814. // 响应式调整图表大小
  815. window.addEventListener('resize', function() {
  816. cropDistributionChart.resize();
  817. yieldTrendChart.resize();
  818. regionMapChart.resize();
  819. deviceStatusChart.resize();
  820. resourceUsageChart.resize();
  821. weatherMonitorChart.resize();
  822. deviceDistributionChart.resize();
  823. });
  824. </script>
  825. </body>
  826. </html>