chart4.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div>
  3. <charts
  4. style="margin-top: -40px"
  5. id="bizchart4"
  6. height="230px"
  7. width="460px"
  8. :option="option"
  9. />
  10. </div>
  11. </template>
  12. <script lang="js">
  13. import charts from '../../../components/echarts/index.vue'
  14. import * as echarts from "echarts";
  15. export default {
  16. components: {charts},
  17. data() {
  18. return {
  19. option: {
  20. dataset: {
  21. dimensions: ['product', '2016', '2017'],
  22. source: [
  23. {product: '1', 2016: 85.8, 2017: 93.7},
  24. {product: '2', 2016: 73.4, 2017: 55.1},
  25. {product: '3', 2016: 65.2, 2017: 82.5},
  26. {product: '4', 2016: 53.9, 2017: 39.1},
  27. {product: '5', 2016: 53.9, 2017: 39.1}
  28. ]
  29. },
  30. xAxis: {
  31. type: 'category',
  32. axisLine: {
  33. lineStyle: {
  34. color: "#a4a2a2",
  35. }
  36. }
  37. },
  38. yAxis: {
  39. axisLine: {
  40. lineStyle: {
  41. color: "#a4a2a2",
  42. }
  43. },
  44. splitLine: {
  45. show: true,
  46. lineStyle: {
  47. color:'rgba(128,126,126,0.25)'
  48. },
  49. },
  50. },
  51. label: {
  52. show: true,
  53. position: 'top',
  54. },
  55. textStyle: {
  56. color:'rgba(245,126,31,0.74)'
  57. },
  58. series: [
  59. {
  60. type: 'bar',
  61. itemStyle: {
  62. normal: {
  63. color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  64. offset: 1,
  65. color: 'rgba(54,131,122,0.84)'
  66. }, {
  67. offset: 0,
  68. color: 'rgba(15,227,202,0.54)'
  69. }]),
  70. }
  71. },
  72. }, {
  73. type: 'bar',
  74. itemStyle: {
  75. normal: {
  76. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  77. offset: 1,
  78. color: 'rgba(70,52,38,0.84)'
  79. }, {
  80. offset: 0,
  81. color: 'rgba(245,126,31,0.54)'
  82. }]),
  83. }
  84. },
  85. },
  86. ]
  87. }
  88. }
  89. },
  90. created() {
  91. this.timingAcquisition()
  92. },
  93. methods: {
  94. timingAcquisition() {
  95. setInterval(() => {
  96. }, 10000)
  97. },
  98. }
  99. }
  100. </script>