ChartCard.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <!-- 组合chart外边框 -->
  3. <div>
  4. <!-- 上部倾斜方块、标题和分割线 -->
  5. <div class="displayFlex">
  6. <div class="borders2"></div>
  7. <div class="chartTitle">
  8. {{ title }}
  9. <div class="chartTitleBorder"></div>
  10. </div>
  11. </div>
  12. <!-- chart主题 -->
  13. <div style="height: 75px">
  14. <LineChart :categoryData="['2020年', '2021年', '2022年']" :valueData="[1024, 1026, 1025]" />
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. /**
  20. * 标题chart组合组件(首页MenuCard中的下部经常用到)
  21. * @author: LiuMengxiang
  22. * @Date: 2022年11月14-18日
  23. */
  24. import LineChart from "@/components/chart/LineChart.vue";
  25. export default {
  26. name: "ChartCard",
  27. components: { LineChart },
  28. data() {
  29. return {};
  30. },
  31. mounted() {},
  32. props: [],
  33. methods: {},
  34. watch: {}
  35. };
  36. </script>
  37. <style lang="less" scoped>
  38. .displayFlex {
  39. display: flex;
  40. align-content: center;
  41. align-items: center;
  42. justify-content: space-between;
  43. flex-wrap: nowrap;
  44. position: relative;
  45. .borders {
  46. position: absolute;
  47. left: 50%;
  48. top: 50%;
  49. transform: translate(-50%, -50%) rotate(45deg);
  50. width: 110px;
  51. height: 100px;
  52. background: linear-gradient(to left, #00aaff, #00aaff) left top no-repeat,
  53. linear-gradient(to bottom, #00aaff, #00aaff) left top no-repeat,
  54. linear-gradient(to left, #00aaff, #00aaff) right top no-repeat,
  55. linear-gradient(to bottom, #00aaff, #00aaff) right top no-repeat,
  56. linear-gradient(to left, #00aaff, #00aaff) left bottom no-repeat,
  57. linear-gradient(to bottom, #00aaff, #00aaff) left bottom no-repeat,
  58. linear-gradient(to left, #00aaff, #00aaff) right bottom no-repeat,
  59. linear-gradient(to left, #00aaff, #00aaff) right bottom no-repeat;
  60. background-size: 6px 6px, 6px 6px, 6px 6px, 6px 6px;
  61. }
  62. }
  63. .borders2 {
  64. width: 10px;
  65. height: 10px;
  66. background-color: #74ffff;
  67. transform: rotate(45deg);
  68. }
  69. .chartTitle {
  70. position: relative;
  71. width: 100%;
  72. font-size: 18px;
  73. font-family: pingfangSC;
  74. font-weight: bold;
  75. color: #74ffff;
  76. margin-left: 10px;
  77. background: linear-gradient(180deg, #ffffff 0%, #33eeff 100%);
  78. -webkit-background-clip: text;
  79. -webkit-text-fill-color: transparent;
  80. border-bottom: 1px solid transparent;
  81. border-image: --webkit-linear-gradient(to right, #33eeff, transparent) 1;
  82. border-image: --moz-linear-gradient(to right, #33eeff, transparent) 1;
  83. border-image: linear-gradient(to right, #33eeff, transparent) 1;
  84. }
  85. .chartTitleBorder {
  86. position: absolute;
  87. right: 0;
  88. bottom: -2px;
  89. width: 10px;
  90. height: 3px;
  91. background: #00a8ff;
  92. border-radius: 2px;
  93. }
  94. </style>