individualPerformance.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div>
  3. <div id="inpm" 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 inpms= echarts.init(document.getElementById("inpm"))
  32. let option = {
  33. legend: {
  34. textStyle:{
  35. color:'#fff'
  36. }
  37. },
  38. tooltip: {},
  39. color:['#FFFF66'],
  40. dataset: {
  41. dimensions: ['lei_bie_', 'jiage'],
  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: [{ name: '销量',type: 'bar',barWidth:'10%',label: {show: true,position: 'top'} }]
  79. };
  80. option && inpms.setOption(option);
  81. }
  82. },
  83. },
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. </style>