bar-mini-chart.vue 1.7 KB

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