123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <view class="chart-container">
- <view class="chart-name">
- <text class="chart-name-text">近期成绩对比</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="column" :chartData="chartData" :loadingType="4" background="none" />
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "column-chart",
- data() {
- return {
- chartData: {
- categories: [
- "数学",
- "语文",
- "英语",
- "体育",
- "科学",
- "思品"
- ],
- series: [{
- "name": "最近成绩",
- "data": [
- 91,
- 92,
- 94,
- 88,
- 82,
- 89
- ]
- },
- {
- "name": "上次成绩",
- "data": [
- 88,
- 84,
- 97,
- 92,
- 89,
- 81
- ]
- }
- ],
- },
- };
- }
- }
- </script>
- <style lang="scss">
- .chart-container {
- margin: 10px;
- padding: 5px 5px 5px 2px;
- border-radius: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 3px 3px 5px 1px rgba(0, 0, 0, 0.05);
-
- .chart-name {
- width: 100%;
- text-align: left;
- margin-left: 18px;
- margin-top: 8px;
-
- .chart-name-text {
- font-size: 13px;
- }
- }
-
- /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
- .charts-box {
- width: 100%;
- height: 190px;
- }
- }
- </style>
|