123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="chart-container">
- <view class="chart-name">
- <text class="chart-name-text">总成绩对比</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="line" :chartData="chartData" :loadingType="4"/>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- chartData: {
- categories: [
- "测验1",
- "测验2",
- "测验3",
- "测验4",
- "测验5",
- ],
- series: [{
- "name": "孩子总分",
- "data": [
- 400,
- 390,
- 380,
- 399,
- 366,
- ]
- },
- {
- "name": "班级平均分",
- "data": [
- 360,
- 377,
- 355,
- 322,
- 338,
- ]
- },
- {
- "name": "年级平均分",
- "data": [
- 333,
- 346,
- 364,
- 347,
- 355,
- ]
- }
- ],
- },
- };
- }
- }
- </script>
- <style lang="scss">
- .chart-container {
- margin: 20px 10px;
- padding: 4px 4px 4px 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>
|