customerStatisticsM.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div>
  3. <div id="chartM" style="width:100%;height:85%"></div>
  4. </div>
  5. </template>
  6. <script>
  7. import echarts from 'echarts'
  8. export default {
  9. data() {
  10. return {
  11. // title:'人员培训',
  12. dialogOff:false,
  13. }
  14. },
  15. props:{
  16. data: {
  17. type: Array,
  18. }
  19. },
  20. watch: {
  21. data(v) {
  22. this.getEchartData()
  23. }
  24. },
  25. mounted() {
  26. this.getEchartData()
  27. },
  28. methods: {
  29. getEchartData() {
  30. if (true) {
  31. let mcm = echarts.init(document.getElementById("chartM"))
  32. let option = {
  33. legend: {
  34. textStyle:{
  35. color:'#fff'
  36. }
  37. },
  38. tooltip: {},
  39. color:['#FF33FF','#66FFFF','#33CC00'],
  40. dataset: {
  41. dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
  42. source: this.data
  43. },
  44. xAxis: {
  45. type: 'category',
  46. axisLabel:{//修改坐标系字体颜色
  47. show:true,
  48. textStyle:{
  49. color:"#fff"
  50. }
  51. },
  52. axisLine: {
  53. show: true,
  54. lineStyle: {
  55. color: "rgba(255,255,255,1)",
  56. type: "solid"
  57. }
  58. }
  59. },
  60. yAxis: {
  61. axisLabel:{//修改坐标系字体颜色
  62. show:true,
  63. textStyle:{
  64. color:"#fff"
  65. }
  66. },
  67. axisLine: {//y轴线的颜色以及宽度
  68. show: true,
  69. lineStyle: {
  70. color: "rgba(255,255,255,1)",
  71. type: "solid"
  72. },
  73. },
  74. splitLine: {
  75. show: false
  76. }
  77. },
  78. series: [
  79. {
  80. name: '潜在客户数量',
  81. type: 'bar',
  82. label: {
  83. show: true,
  84. position: 'top'
  85. }
  86. }, {
  87. name: '意向客户数量',
  88. type: 'bar',
  89. label: {
  90. show: true,
  91. position: 'top'
  92. }
  93. }, {
  94. name: '已签约客户数量',
  95. type: 'bar',
  96. label: {
  97. show: true,
  98. position: 'top'
  99. }
  100. }
  101. ]
  102. };
  103. option && mcm.setOption(option);
  104. }
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. </style>