customerStatistics.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div>
  3. <div id="chart" 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. default: []
  19. }
  20. },
  21. watch: {
  22. data(v) {
  23. this.getEchartData()
  24. }
  25. },
  26. mounted() {
  27. this.getEchartData()
  28. },
  29. methods: {
  30. getEchartData() {
  31. if (true) {
  32. let myChart = echarts.init(document.getElementById("chart"))
  33. let option = {
  34. legend: {
  35. textStyle:{
  36. color:'#fff'
  37. }
  38. },
  39. tooltip: {},
  40. color:['#FF3366','#66FFFF','#66CC00'],
  41. dataset: {
  42. dimensions: ['lei_bie_', 'qznum', 'ynnum', 'khnum'],
  43. source: this.data
  44. },
  45. xAxis: {
  46. type: 'category',
  47. axisLabel:{//修改坐标系字体颜色
  48. show:true,
  49. textStyle:{
  50. color:"#fff"
  51. }
  52. },
  53. axisLine: {
  54. show: true,
  55. lineStyle: {
  56. color: "rgba(255,255,255,1)",
  57. type: "solid"
  58. }
  59. }
  60. },
  61. yAxis: {
  62. axisLabel:{//修改坐标系字体颜色
  63. show:true,
  64. textStyle:{
  65. color:"#fff"
  66. }
  67. },
  68. axisLine: {//y轴线的颜色以及宽度
  69. show: true,
  70. lineStyle: {
  71. color: "rgba(255,255,255,1)",
  72. type: "solid"
  73. },
  74. },
  75. splitLine: {
  76. show: false
  77. }
  78. },
  79. // Declare several bar series, each will be mapped
  80. // to a column of dataset.source by default.
  81. series: [
  82. {
  83. name: '潜在客户数量',
  84. type: 'bar',
  85. label: {
  86. show: true,
  87. position: 'top'
  88. }
  89. }, {
  90. name: '意向客户数量',
  91. type: 'bar',
  92. label: {
  93. show: true,
  94. position: 'top'
  95. }
  96. }, {
  97. name: '已签约客户数量',
  98. type: 'bar',
  99. label: {
  100. show: true,
  101. position: 'top'
  102. }
  103. }
  104. ]
  105. };
  106. option && myChart.setOption(option);
  107. }
  108. },
  109. },
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. </style>