12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <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 {
- name: "line-chart",
- 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: 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>
|