w-area-charts.vue 1.9 KB

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