echart-contact.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view>
  3. <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
  4. </view>
  5. </template>
  6. <script>
  7. import { mapState, mapMutations } from 'vuex'
  8. export default {
  9. data() {
  10. return {
  11. chartData: {},
  12. opts: {
  13. legend:{
  14. show:false
  15. },
  16. color: ["#81ecec"],
  17. dataLabel:true,
  18. padding: [15, 30, 0, 5],
  19. enableScroll: false,
  20. xAxis: {
  21. disableGrid: true,
  22. min: 0,
  23. axisLine: false,
  24. max: 40 ,
  25. rotateLabel:true,
  26. format:'xAxisDemo3'
  27. },
  28. yAxis: {
  29. fontSize:12,
  30. fontColor:'#CCCCCC',
  31. axisLineColor:'#DCDCDC',
  32. gridColor:'#DCDCDC',
  33. boundaryGap: 'justify',
  34. disabled:true,
  35. axisLine: false,
  36. min: 0,
  37. max: 40 ,
  38. },
  39. extra: {
  40. column: {
  41. type: "group",
  42. width: 20,
  43. meterBorde: 1,
  44. meterFillColor: "#FFFFFF",
  45. activeBgColor: "#000000",
  46. activeBgOpacity: 0.08,
  47. seriesGap: 2,
  48. categoryGap: 3,
  49. barBorderCircle: false,
  50. linearType: "custom",
  51. linearOpacity: 1,
  52. customColor:['#00cec9','#81ecec'],
  53. colorStop: 0
  54. }
  55. }
  56. }
  57. }
  58. },
  59. created() {
  60. this.getServerData()
  61. },
  62. computed: {},
  63. methods: {
  64. getServerData() {
  65. setTimeout(() => {
  66. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  67. let res = {
  68. categories: [
  69. '美博会',
  70. '玻尿酸',
  71. '氨基酸',
  72. 'Rossa阿萨科技的和',
  73. '啊啊咔咔卡时间段',
  74. '啊啊咔咔卡时间段',
  75. '啊啊咔咔卡时间段',
  76. '啊啊咔咔卡时间段',
  77. '啊啊咔咔卡时间段',
  78. '奥术大师..'
  79. ],
  80. series: [
  81. {
  82. name: '',
  83. data: [50, 72, 100, 83, 63, 42, 42, 42, 42, 42]
  84. }
  85. ]
  86. }
  87. this.chartData = JSON.parse(JSON.stringify(res))
  88. }, 500)
  89. }
  90. },
  91. onShow() {}
  92. }
  93. </script>
  94. <style lang="scss">
  95. </style>