w-area-charts.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <!-- 虫情数据 区域统计图 -->
  3. <view>
  4. <ui-charts ref="wLineCharts" type="area" :ontouch="true" :opts="opts" :chartData="chartData"></ui-charts>
  5. </view>
  6. </template>
  7. <script>
  8. /**
  9. * 虫情数据 区域统计图
  10. * @example <w-line-charts :chartData="chartData"></w-line-charts>
  11. * @description 统计图官方说明文档 https://www.ucharts.cn
  12. */
  13. export default {
  14. name: 'w-line-charts',
  15. data() {
  16. return {
  17. opts: {
  18. loadingType: 0,
  19. color: ["#317afd","#45EAB7"],
  20. padding: [10, 0, 0, 5],
  21. legend: {
  22. position: 'top',
  23. float: 'left'
  24. },
  25. dataLabel: false,
  26. // dataPointShape: false,
  27. dataPointShapeType: 'hollow',
  28. xAxis: {
  29. disableGrid: true,
  30. boundaryGap: "justify",
  31. fontColor: '#999',
  32. fontSize: 10,
  33. axisLineColor: '#F4F7F9'
  34. },
  35. yAxis: {
  36. gridColor: '#F4F7F9',
  37. gridType: "solid",
  38. dashLength: 2,
  39. data: [{
  40. axisLineColor: '#F4F7F9',
  41. fontColor: '#999',
  42. fontSize: 10,
  43. }]
  44. },
  45. extra: {
  46. area: {
  47. type: "curve",
  48. width: 3,
  49. gradient:true
  50. },
  51. tooltip: {
  52. showArrow: true,
  53. gridType: 'dash',
  54. labelBgColor: '#66ccff',
  55. gridColor: '#317afd'
  56. },
  57. markLine: {
  58. type: 'dash',
  59. dashLength: 5,
  60. data: [{
  61. lineColor: '#1A6EFE'
  62. }]
  63. }
  64. }
  65. },
  66. }
  67. },
  68. props: {
  69. /** 统计图数据 对象数据格式
  70. categories: [],// 类别
  71. series: [{
  72. name: "土壤温度(°C)",
  73. data: []
  74. }]
  75. */
  76. chartData: {
  77. type: [Array, Object],
  78. default () {
  79. return []
  80. }
  81. },
  82. },
  83. watch: {
  84. chartData: {
  85. deep: true, // 深度监听
  86. handler(val) {
  87. this.wLineCharts.updataUChart()
  88. }
  89. }
  90. },
  91. methods: {}
  92. };
  93. </script>
  94. <style lang="scss">
  95. </style>