LeftChartUnder.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div class="left-chart-3">
  3. <dv-capsule-chart class="lc3-chart" :config="config" />
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: "LeftChart3",
  9. props: {
  10. dataList: {
  11. type: Array,
  12. default: [],
  13. },
  14. },
  15. data() {
  16. return {
  17. config: {
  18. data: [],
  19. colors: ["#00baff", "#3de7c9", "#fff", "#ffc530", "#469f4b"],
  20. unit: "人",
  21. showValue: true
  22. },
  23. };
  24. },
  25. created() {
  26. this.getData();
  27. },
  28. methods: {
  29. getData() {
  30. this.config.data = this.dataList.map((item) => {
  31. return {
  32. name: item.age,
  33. value: item.count,
  34. };
  35. });
  36. },
  37. },
  38. };
  39. </script>
  40. <style lang="scss">
  41. .left-chart-3 {
  42. width: 100%;
  43. height: 70%;
  44. display: flex;
  45. flex-direction: column;
  46. .lc3-header {
  47. height: 20px;
  48. line-height: 20px;
  49. font-size: 16px;
  50. text-indent: 20px;
  51. margin-top: 10px;
  52. }
  53. .lc3-details {
  54. height: 40px;
  55. font-size: 16px;
  56. display: flex;
  57. align-items: center;
  58. text-indent: 20px;
  59. span {
  60. color: #096dd9;
  61. font-weight: bold;
  62. font-size: 35px;
  63. margin-left: 20px;
  64. }
  65. }
  66. .lc3-chart {
  67. flex: 1;
  68. padding: 0 10px;
  69. }
  70. }
  71. </style>