<template>
	<view class="chart-container">
		<view class="chart-name">
			<view class="t-icon t-icon-xtubiao-4"></view>
			<text class="chart-name-text">学期成绩走势</text>
		</view>
		
		<view class="charts-box">
			<qiun-data-charts class="chart" :canvas2d='true' canvasId='canvans5' type="mainline" :chartData="chartData" :loadingType="4"/>
		</view>
	</view>
</template>

<script>
	export default {
		name:"mainline-mini-chart",
		props: {},
		data() {
			return {	
				chartData: {},
				queryObj: {}

			};
		},
		methods:{
			getChartData(){
				this.chartData = {
					categories: [
						"开学考试",
						"第一月考",
						"第二月考",
						"期中考试",
						"第三月考",
						"期末考试"
					],
					series: [{
						"name": "总成绩",
						"data": [
							555,
							577,
							540,
							588,
							563,
							594
						]
					}],
				}
				
			}
		},
		//创建组件生命周期函数
		created(){
			this.getChartData()
		}
	}
</script>

<style lang="scss">
.chart-container {
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		background-color: #FFFFFF;
		box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.05);
		width: 706rpx;
	
		.chart-name {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			width: 100%;
			margin: 20rpx 0 20rpx 40rpx;
			
			.chart-name-text {
				margin-left: 20rpx;
				font-size: 30rpx;
				font-weight: bold;
				color: #3B4144;
			}
		}
	.charts-box{
		width: 100%;
		height:300rpx;
	}
}
.t-icon{
		width: 40rpx;
		height: 40rpx;
	}
</style>
