column-echarts.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="charts-box">
  3. <qiun-data-charts
  4. type="column"
  5. :opts="opts"
  6. :ontouch="true"
  7. :chartData="chartData"
  8. />
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. chartData: {},
  16. opts: {
  17. color: ["#FE6915",],
  18. padding: [15,15,0,5],
  19. enableScroll: true,
  20. legend: {
  21. show:false,
  22. },
  23. xAxis: {
  24. axisLine:false,
  25. disableGrid: true,
  26. itemCount:5,
  27. fontColor:'#999',
  28. scrollShow:true,
  29. },
  30. yAxis: {
  31. data: [
  32. {
  33. min: 0,
  34. fontColor:'#999',
  35. disabled:true,
  36. }
  37. ]
  38. },
  39. extra: {
  40. column: {
  41. type: "group",
  42. width: 8,
  43. activeBgColor: "#333",
  44. activeBgOpacity: 0.08
  45. },
  46. tooltip:{
  47. legendShow:false,
  48. bgColor:'#333',
  49. borderRadius:4,
  50. bgOpacity:1,
  51. },
  52. }
  53. }
  54. };
  55. },
  56. mounted() {
  57. // this.getServerData();
  58. },
  59. methods: {
  60. getServerData() {
  61. let res = {
  62. categories: ["08:10","12:11","12:12","12:16","19:11","22:11","22:12","22:13"],
  63. series: [
  64. {
  65. name: "收益",
  66. data: [35,36,31,33,13,34,1,6,]
  67. },
  68. ]
  69. };
  70. this.chartData = JSON.parse(JSON.stringify(res));
  71. },
  72. }
  73. };
  74. </script>
  75. <style scoped>
  76. .charts-box {
  77. width: 100%;
  78. height: 100%;
  79. }
  80. </style>