1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <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: 20px 10px;
- padding: 5px 5px 5px 2px;
- border-radius: 15px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
-
- .chart-name {
- width: 100%;
- text-align: left;
- margin-left: 30px;
- margin-top: 8px;
- font-weight: bold;
- color: #3B4144;
-
- .chart-name-text {
- font-size: 13px;
- }
- }
-
- /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
- .charts-box {
- width: 100%;
- height: 190px;
- }
- }
- </style>
|