radar-mini-chart.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="chart-container">
  3. <view class="chart-name">
  4. <view class="t-icon t-icon-xtubiao-9"></view>
  5. <text class="chart-name-text">学年能力</text>
  6. </view>
  7. <view class="charts-box">
  8. <qiun-data-charts
  9. type="mini-radar"
  10. :chartData="chartData"
  11. :loadingType="4"
  12. background="none"
  13. :canvas2d='true' canvasId='canvans998'
  14. />
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name:"radar-mini-chart",
  21. props:{
  22. miniChartData:{
  23. type: Object,
  24. default: {
  25. categories: ["语文",
  26. "数学",
  27. "英语",
  28. "科学",
  29. "体育",
  30. "思品"
  31. ],
  32. series: [{
  33. "name": "开学考试",
  34. "data": [
  35. 90,
  36. 100,
  37. 77,
  38. 88,
  39. 95,
  40. 85
  41. ]
  42. },
  43. {
  44. "name": "期中考试",
  45. "data": [
  46. 93,
  47. 80,
  48. 99,
  49. 76,
  50. 88,
  51. 100
  52. ]
  53. },
  54. {
  55. "name": "期末考试",
  56. "data": [
  57. 82,
  58. 90,
  59. 65,
  60. 99,
  61. 70,
  62. 92
  63. ]
  64. }
  65. ],
  66. }
  67. }
  68. },
  69. data() {
  70. return {
  71. chartData: this.miniChartData
  72. };
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .chart-container {
  78. border-radius: 20rpx;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. flex-direction: column;
  83. background-color: #FFFFFF;
  84. box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.05);
  85. width: 340rpx;
  86. .chart-name {
  87. display: flex;
  88. align-items: center;
  89. justify-content: flex-start;
  90. width: 100%;
  91. margin: 20rpx 0 20rpx 40rpx;
  92. .chart-name-text {
  93. margin-left: 20rpx;
  94. font-size: 30rpx;
  95. font-weight: bold;
  96. color: #3B4144;
  97. }
  98. }
  99. .charts-box{
  100. margin: -20rpx 0 0 0;
  101. width: 100%;
  102. height: 350rpx;
  103. }
  104. }
  105. .t-icon{
  106. width: 40rpx;
  107. height: 40rpx;
  108. }
  109. </style>