vue 记录一个echarts页面 单色环形饼图 多色环形饼图 柱状图加折线图 饼状图 双柱状图 雷达图 多色堆叠柱状图


“设备使用”模块没有做 因为项目不需要 仅自己记录使用 可供参考 那么上代码

<template><!--app-container--><div class="home-wrap"><div class="wrap" v-if="schoolId"><!--第一块--><div class="statistical-box"><div class="title-common"><div class="title-common-left"><img src="../assets/images/index_home.png" class="icon-20">首页</div><el-select v-model="infoValue" placeholder="请选择" size="mini" @change="handleSelectInfoChange"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select></div><div class="statistical-main"><!--活动教案--><div class="teach-plan"><div class="title-common"><div class="title-common-left"><img src="../assets/images/index_plan.png" class="icon-20">活动教案              </div></div><div class="teach-plan-cont"><div class="tpc-lef"><div class="tpc-lef-list"><div class="d1">新增教案</div><div class="d2">{{ teachPlanInfo ? teachPlanInfo.addTeachPlans : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">修改教案</div><div class="d2">{{ teachPlanInfo ? teachPlanInfo.editTeachPlans : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">累计教案</div><div class="d2">{{ teachPlanInfo ? teachPlanInfo.totalTeachPlans : 0 }}</div></div></div><div class="tpc-rig"><div class="tpc-rig-list"><div class="d1">{{ teachPlanInfo ? teachPlanInfo.prepareTeachPlans : 0 }}</div><div class="d2">备课次数</div></div><div class="tpc-rig-list"><div class="d1">{{ teachPlanInfo ? teachPlanInfo.participateInTeachers : 0 }}</div><div class="d2">参与老师</div></div></div></div></div><!--活动教案-end--><!--体育活动--><div class="teach-plan physical-activity"><div class="title-common"><div class="title-common-left"><img src="../assets/images/index_class.png" class="icon-20">体育活动              </div></div><div class="teach-plan-cont"><div class="tpc-lef"><div class="tpc-lef-list"><div class="d1">活动班级</div><div class="d2">{{ classRecordInfo ? classRecordInfo.classNum : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">参与幼儿</div><div class="d2">{{ classRecordInfo ? classRecordInfo.studentNum : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">均课时长</div><div class="d2">{{ classRecordInfo ? classRecordInfo.avgTime : 0 }}</div></div></div><div class="tpc-rig"><div class="tpc-rig-list"><div class="d1">{{ classRecordInfo ? classRecordInfo.countOfPeople : 0 }}</div><div class="d2">幼儿参与人次</div></div><div class="tpc-rig-list"><div class="d1">{{ classRecordInfo ? classRecordInfo.countOfRecord : 0 }}</div><div class="d2">活动次数</div></div></div></div></div><!--体育活动-end--><!--观察记录--><div class="teach-plan observe-record"><div class="title-common"><div class="title-common-left"><img src="../assets/images/index_record.png" class="icon-20">观察记录              </div></div><div class="teach-plan-cont"><div class="tpc-lef"><div class="tpc-lef-list"><div class="d1">观察记录数</div><div class="d2">{{ observeRecordInfo ? observeRecordInfo.completedRecordNumber : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">观察幼儿</div><div class="d2">{{ observeRecordInfo ? observeRecordInfo.observedStudentNumber : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">记录班级</div><div class="d2">{{ observeRecordInfo ? observeRecordInfo.observedClassNumber : 0 }}</div></div></div><div class="tpc-rig"><div class="pie-box"><div class="d1" id="completionRate" style="width: 66px; height: 66px;"></div><div class="d2">完成人数占比</div></div></div></div></div><!--观察记录-end--><!--体测情况--><div class="teach-plan condition"><div class="title-common"><div class="title-common-left"><img src="../assets/images/index_physical.png" class="icon-20">体测情况              </div></div><div class="teach-plan-cont"><div class="tpc-lef"><div class="tpc-lef-list"><div class="d1">幼儿人数</div><div class="d2">{{ phyInfo ? phyInfo.studentNum : 0 }}</div></div><div class="tpc-lef-list"><div class="d1">参与班级</div><div class="d2">{{ phyInfo ? phyInfo.classNum : 0 }}</div></div></div><div class="tpc-rig"><div class="pie-box"><div class="d1" id="standardRate" style="width: 66px; height: 66px;"></div><div class="d2">达标率</div></div></div></div></div><!--体测情况-end--></div></div><!--第一块-end--><!--第二块--><div class="activty-box"><!--活动教案--><div class="activity-plan"><div class="title-common"><div class="title-common-left">活动教案</div><el-select v-model="planValue" placeholder="请选择" size="mini" @change="handleSelectPlanChange"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select></div><!--头部-end--><el-table class="activity-teacher" :data="tableData" style="width: 100%" height="400" v-loading="loading":header-cell-style="{ background: '#02a7f0', color: '#fff', fontWeight: 400 }"><el-table-column prop="date" label="教育" width="130"><template slot-scope="scope"><div class="student-mes"><img :src="scope.row.avatar ? scope.row.avatar : defaultAvatar" alt="" class="student-img" /><div class="d1">{{ scope.row.name }}</div></div></template></el-table-column><el-table-column prop="addTeachPlans" label="新增教案" align="center"></el-table-column><el-table-column prop="editTeachPlans" label="修改教案" align="center"></el-table-column><el-table-column prop="prepareTeachPlans" label="备课次数" align="center"></el-table-column></el-table></div><!--活动教案-end--><!--班级活动--><div class="activity-class"><div class="title-common"><div class="title-common-left">班级活动</div><el-select v-model="classValue" placeholder="请选择" size="mini" @change="handleSelectClassChange"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select></div><!--头部-end--><div class="flex-box jc-sb"><div class="activity-class-lef"><div style="width:400px; height: 400px" id="activityRate"></div></div><!--班级统计 柱状图+折线图--><div class="activity-class-rig"><div style="width: 100%; height: 400px" id="classRecord"></div></div></div></div><!--班级活动-end--></div><!--第二块-end--><!--第三块--><div class="activity-class width-big"><div class="title-common"><div class="title-common-left">观察记录</div><el-select v-model="recordValue" placeholder="请选择" size="mini" @change="handleSelectRecordChange"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select></div><!--头部-end--><div class="flex-box jc-sb"><div class="activity-class-lef"><div style="width:480px; height: 400px" id="recordPie"></div></div><!--班级统计 柱状图+折线图--><div class="activity-class-rig"><div style="width: 100%; height: 400px" id="recordBarDouble"></div></div></div></div><div class="activity-class width-big"><div class="title-common"><div class="title-common-left">体测情况</div><div class="title-common-right"><el-radio-group v-model="radio" style="margin-right: 20px;" @change="handleRadioChange"><el-radio :label="1">2003年</el-radio><el-radio :label="2">2023年</el-radio></el-radio-group><el-select v-model="physicalValue" placeholder="请选择" size="mini" @change="handleSelectPhysicalChange"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select></div></div><!--头部-end--><div class="flex-box jc-sb"><div class="activity-class-lef"><div style="width:480px; height: 400px" id="physicalRadar"></div></div><!--班级统计 柱状图+折线图--><div class="activity-class-rig"><div style="width: 100%; height: 400px" id="physicalBarMore"></div></div></div></div><!--第三块-end--></div><div class="home" v-else><img src="../assets/images/logo_big.png" /></div>    </div>
</template><script>
import { getHomeInfo, getHomeBaseInfo, getPlanBaseInfo, getClassBaseInfo, getRecordBaseInfo, getPhysicalBaseInfo } from "@/api/index";
import * as echarts from 'echarts';
import defaultAvatar from "@/assets/images/profile.jpg";export default {name: "Index",data() {return {loading: false,radio: 1,//体测情况年份选择defaultAvatar,// 版本号version: "3.8.5",options: [{value: '1',label: '近一个月'}, {value: '3',label: '近三个月'}, {value: '6',label: '近六个月'}, {value: '9',label: '近九个月'}, {value: '12',label: '近十二个月'}],info: null,//页面总信息teachPlanInfo: null,//活动教案-基本信息classRecordInfo: null,//体育活动-基本信息observeRecordInfo: null,//观察记录-基本信息phyInfo: null,//体测情况-基本信息infoValue: null,//首页-下拉选择值planValue: null,//活动教案-下拉选择值classValue: null,//班级活动-下拉选择值recordValue: null,//观察记录-下拉选择值physicalValue: null,//体测情况-下拉选择值chartdom: null,activitydom: null,classActivityDom: null,//班级活动recordPieDom: null,//观察记录实心饼图recordBarDoubleDom: null,//观察记录双柱状图physicalRadarDom: null,//体测情况雷达图physicalBarMoreDom: null,//体测情况多色柱状图tableData: [],schoolId: null,};},created() {this.schoolId = this.$store.state.user.schoolIdif(this.schoolId){this.getInfo()}},mounted() {},methods: {//首页-下拉选择handleSelectInfoChange(value) {let params = this.schoolId + '/' + value + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0getHomeBaseInfo(params).then(res => {if (res.code == 200) {let odata = res.datathis.teachPlanInfo = odata.teachPlanInfothis.classRecordInfo = odata.classRecordInfothis.observeRecordInfo = odata.observeRecordInfothis.phyInfo = odata.phyInfo//观察记录环形饼图数据          let completionRate = ((this.observeRecordInfo.observedStudentNumber / this.observeRecordInfo.studentNumber) * 100).toFixed(0)this.pieEcharts('completionRate', completionRate);//体测情况环形饼图数据let standardRate =  this.phyInfo.passRate || 0this.pieEcharts('standardRate', standardRate);}});},//活动教案-下拉选择handleSelectPlanChange(value) {let params = this.schoolId + '/' + value + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0this.loading = truegetPlanBaseInfo(params).then(res => {if (res.code == 200) {this.tableData = res.data.teachPlansDetailsthis.loading = false}});},//班级活动-下拉选择handleSelectClassChange(value) {let params = this.schoolId + '/' + value + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0getClassBaseInfo(params).then(res => {if (res.code == 200) {let oinfo = this.infooinfo.classRecordDetail.classTagList = res.data.classTagList//班级活动-环形饼图this.pieEcharts2('activityRate');//班级统计 柱状图+折线图          this.info.classRecordDetail.classRecordList = res.data.classRecordListthis.info.classRecordDetail.classStudentList = res.data.classStudentListthis.pieBarEcharts('classRecord')}});},//观察记录-下拉选择handleSelectRecordChange(value) {let params = this.schoolId + '/' + value + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0getRecordBaseInfo(params).then(res => {if (res.code == 200) {//观察记录饼图this.info.observeRecordAreaInfo.series = res.data.seriesthis.pieSolidEcharts();//观察记录双柱状图this.info.observeRecordAreaInfo.classObservationVOList = res.data.classObservationVOListthis.barDoubleEcharts();}});},//体测情况-下拉选择handleSelectPhysicalChange(value) {let params = this.schoolId + '/' + value + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0getPhysicalBaseInfo(params).then(res => {if (res.code == 200) {//体测情况雷达图this.info.classPhyInfoDetail.data2003 = res.data.data2003this.info.classPhyInfoDetail.data2023 = res.data.data2023let avgArr = this.getAvgArr()this.physicalRadarEcharts(avgArr)//体测情况柱状堆叠图this.physicalBarMoreEcharts()}});},getInfo() {let params = this.schoolId + '/' + '0' + '/' + '0' //第一个参数schoolId 第二个参数month 第三个参数week week在pc端默认是0getHomeInfo(params).then(res => {if (res.code == 200) {let oinfo = res.datathis.info = oinfolet basicInfo = oinfo.basicInfothis.teachPlanInfo = basicInfo.teachPlanInfothis.classRecordInfo = basicInfo.classRecordInfothis.observeRecordInfo = basicInfo.observeRecordInfothis.phyInfo = basicInfo.phyInfo//观察记录环形饼图数据let completionRate = 0if (this.info && this.info.basicInfo && this.info.basicInfo.observeRecordInfo && this.info.basicInfo.observeRecordInfo.studentNumber > 0) {completionRate = ((this.info.basicInfo.observeRecordInfo.observedStudentNumber / this.info.basicInfo.observeRecordInfo.studentNumber) * 100).toFixed(0)}this.pieEcharts('completionRate', completionRate);//体测情况环形饼图数据let standardRate = 0if (this.info && this.info.basicInfo && this.info.basicInfo.phyInfo) {standardRate = this.info.basicInfo.phyInfo.passRate}this.pieEcharts('standardRate', standardRate);//活动教案if (this.info && this.info.teachPlanDetailInfo && this.info.teachPlanDetailInfo.teachPlansDetails && this.info.teachPlanDetailInfo.teachPlansDetails.length > 0) {this.tableData = this.info.teachPlanDetailInfo.teachPlansDetails}//班级活动-环形饼图this.pieEcharts2('activityRate');//班级统计 柱状图+折线图          this.pieBarEcharts('classRecord')//观察记录饼图this.pieSolidEcharts();//观察记录双柱状图this.barDoubleEcharts();//判断是2003 还是 2023版本if (this.info && this.info.classPhyInfoDetail && this.info.classPhyInfoDetail.data2003 && !this.isEmptyObject(this.info.classPhyInfoDetail.data2003)) {this.radio = 1} else if (this.info && this.info.classPhyInfoDetail && this.info.classPhyInfoDetail.data2023 && !this.isEmptyObject(this.info.classPhyInfoDetail.data2023)) {this.radio = 2}//体测情况雷达图let avgArr = this.getAvgArr()this.physicalRadarEcharts(avgArr)//体测情况柱状堆叠图this.physicalBarMoreEcharts()}});},//选择年份handleRadioChange(value) {//console.log('当前选中的Radio label:', value);this.radio = valuelet itemAvg = nullif (value == 1) {//2003if (this.info && this.info.classPhyInfoDetail && this.info.classPhyInfoDetail.data2003 && !this.isEmptyObject(this.info.classPhyInfoDetail.data2003)) {itemAvg = this.info.classPhyInfoDetail.data2003.itemAvg}} else {//2023if (this.info && this.info.classPhyInfoDetail && this.info.classPhyInfoDetail.data2023 && !this.isEmptyObject(this.info.classPhyInfoDetail.data2023)) {itemAvg = this.info.classPhyInfoDetail.data2023.itemAvg}}let itemAvgArr = []itemAvgArr[0] = itemAvg.heightScore || 0itemAvgArr[1] = itemAvg.bodyScore || 0itemAvgArr[2] = itemAvg.balanceScore || 0itemAvgArr[3] = itemAvg.upStrengthScore || 0itemAvgArr[4] = itemAvg.downStrengthScore || 0itemAvgArr[5] = itemAvg.sensitivityScore || 0itemAvgArr[6] = itemAvg.flexibilityScore || 0itemAvgArr[7] = itemAvg.coordinationScore || 0// 获取雷达图this.physicalRadarEcharts(itemAvgArr)//体测情况柱状堆叠图this.physicalBarMoreEcharts()},//柱状堆叠图physicalBarMoreEcharts() {const container = document.getElementById('physicalBarMore'); // 获取容器元素this.physicalBarMoreDom = echarts.init(container); // 初始化echarts实例            let odataAll = []let legendData = ['需努力', '合格', '良好', '优秀']let odata = []if (this.radio == 1) {odata = this.info.classPhyInfoDetail.data2003} else if (this.radio == 2) {odata = this.info.classPhyInfoDetail.data2023}let oclassList = odata.classListodataAll[0] = odata.level01odataAll[1] = odata.level02odataAll[2] = odata.level03odataAll[3] = odata.level04var data = {area: oclassList,legend: legendData,data: odataAll,};var colors = ['#ff5371', '#ffd22f', '#26cd7b', '#26a3ff'];var option = {tooltip: {order: 'seriesDesc', //echarts 把tooltip里值的显示顺序倒序trigger: 'axis',axisPointer: {type: 'none',},},color: colors,legend: {bottom: 0,left: 'center',itemWidth: 20,itemHeight: 8,textStyle: {fontSize: 14,padding: [3, 0, 0, 0],},data: data.legend,},grid: {left: '3%',right: '4%',bottom: '13%',containLabel: true,},xAxis: {type: 'category',data: data.area,axisTick: {show: false //隐藏刻度线  },},yAxis: {type: 'value',axisLine: {width: 5,},splitLine: {show: false,},},series: [],};for (var i = 0; i < data.legend.length; i++) {option.series.push({name: data.legend[i],type: 'bar',stack: '总量',barWidth: '45%',barMaxWidth: '50',label: {show: false,position: 'insideRight',},data: data.data[i],});}this.physicalBarMoreDom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.physicalBarMoreDom.resize();});},//判断是不是空对象isEmptyObject(obj) {return Object.keys(obj).length === 0;},//加载的时候获取雷达图的数据getAvgArr() {let itemAvg = nullif (this.radio == 1) {itemAvg = this.info.classPhyInfoDetail.data2003.itemAvg} else if (this.radio == 2) {itemAvg = this.info.classPhyInfoDetail.data2023.itemAvg}//console.log(itemAvg)let itemAvgArr = []itemAvgArr[0] = itemAvg.heightScore || 0itemAvgArr[1] = itemAvg.bodyScore || 0itemAvgArr[2] = itemAvg.balanceScore || 0itemAvgArr[3] = itemAvg.upStrengthScore || 0itemAvgArr[4] = itemAvg.downStrengthScore || 0itemAvgArr[5] = itemAvg.sensitivityScore || 0itemAvgArr[6] = itemAvg.flexibilityScore || 0itemAvgArr[7] = itemAvg.coordinationScore || 0return itemAvgArr},//雷达图physicalRadarEcharts(avgArr) {const container = document.getElementById('physicalRadar'); // 获取容器元素this.physicalRadarDom = echarts.init(container); // 初始化echarts实例      let omax = this.radio == 1 ? 5 : 100let upStrengthName = this.radio == 1 ? '网球掷远' : '握力'let flexibilityName = this.radio == 1 ? '十米折返跑' : '十五米折返跑'let option = {tooltip: {trigger: 'item',},radar: {shape: 'circle',indicator: [{ name: '身高', max: omax },{ name: '体重', max: omax },{ name: '平衡力\n(走平衡木)', max: omax },{ name: '上肢力量\n(' + upStrengthName + ')', max: omax },{ name: '下肢力量\n(立定跳远)', max: omax },{ name: '灵敏性\n(' + flexibilityName + ')', max: omax },{ name: '柔韧性\n(坐位体前屈)', max: omax },{ name: '协调性\n(双脚连续跳)', max: omax }],axisName: { //设置外侧字体的颜色和大小color: '#666',fontSize: 12}},series: [{name: '',type: 'radar',data: [{value: avgArr,name: '体测情况',lineStyle: {color: '#02a7f0' // 雷达图里线的颜色},itemStyle: {normal: {color: '#02a7f0' // 雷达图里线的颜色}}},]}]};this.physicalRadarDom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.physicalRadarDom.resize();});},//双柱状图barDoubleEcharts() {const container = document.getElementById('recordBarDouble'); // 获取容器元素this.recordBarDoubleDom = echarts.init(container); // 初始化echarts实例let classObservationVOList = []if (this.info && this.info.observeRecordAreaInfo && this.info.observeRecordAreaInfo.classObservationVOList && this.info.observeRecordAreaInfo.classObservationVOList.length > 0) {classObservationVOList = this.info.observeRecordAreaInfo.classObservationVOList}let classNameArr = []let completedRecordNumberArr = []let completedStudentNumberArr = []if (classObservationVOList.length > 0) {for (let i in classObservationVOList) {classNameArr.push(classObservationVOList[i].className)completedRecordNumberArr.push(classObservationVOList[i].completedRecordNumber)completedStudentNumberArr.push(classObservationVOList[i].completedStudentNumber)}}let option = {tooltip: {trigger: 'axis',axisPointer: { // 坐标轴指示器,坐标轴触发有效type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'},// formatter(params) {//   let list = []//   let listItem = '';//   let name = '';//   params.forEach((item, i) => {//     name = item.name;//     list.push('<span>' +//       item.seriesName +//       '转资额</span>: ' +//       item.value + ' 万元<br/>'//     );//   });//   listItem = list.join('');//   return '<div class="showBox">' + listItem + '</div>'// }},color: ['#f59a23', '#02a7f0'],legend: {y: 'bottom',itemWidth: 20,itemHeight: 8,},grid: {left: '0',right: '0',bottom: '60',containLabel: true},xAxis: [{data: classNameArr,axisTick: {show: false //隐藏刻度线  },axisLabel: {     //横坐标全部显示 不隔开显示interval: 0}}],yAxis: [{//name: '转资额(万元)',nameTextStyle: {padding: [0, 0, 0, 30]    // 四个数字分别为上右下左与原位置距离},splitArea: {  //隐藏背景网格区域show: false},splitLine: {  //隐藏背景网格线show: true,lineStyle: {type: 'dashed' // 设置分隔线为虚线}},axisTick: {show: false //隐藏刻度线  },axisLine: {      //隐藏y轴show: false}}],series: [{name: '幼儿人数',type: 'bar',barWidth: '25%', // 设置柱子宽度为相对于类目宽度的 50%barMaxWidth: '50',data: completedStudentNumberArr},{name: '观察记录数',type: 'bar',barWidth: '25%', // 设置柱子宽度为相对于类目宽度的 50%barMaxWidth: '50',data: completedRecordNumberArr}]};this.recordBarDoubleDom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.recordBarDoubleDom.resize();});},//实心饼图pieSolidEcharts() {const container = document.getElementById('recordPie'); // 获取容器元素this.recordPieDom = echarts.init(container); // 初始化echarts实例let odata = []if (this.info && this.info.observeRecordAreaInfo && this.info.observeRecordAreaInfo.series && this.info.observeRecordAreaInfo.series.length > 0) {odata = this.info.observeRecordAreaInfo.series}let option = {tooltip: {trigger: 'item',formatter: function (data) {return data.value + '条 ' + data.percent + '%' + "<br/>" + data.name;}},series: [{name: '',type: 'pie',radius: '50%',label: {formatter: function (data) {return data.value + '条 ' + data.percent + '%' + "\n" + data.name;}},data: odata,emphasis: {itemStyle: {shadowBlur: 10,shadowOffsetX: 0,shadowColor: 'rgba(0, 0, 0, 0.5)'}}}]};this.recordPieDom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.recordPieDom.resize();});},//柱状图+折线图 pieBarEcharts(dom) {const that = thisconst container = document.getElementById(dom); // 获取容器元素this.classActivityDom = echarts.init(container); // 初始化echarts实例let option = {color: ['#f59a23', '#02a7f0'],//自定义线和图例的颜色 f59a23 是黄色  02a7f0 是蓝色tooltip: {trigger: 'axis', //显示图例},legend: {bottom: 0, // 图例距离底部的距离//itemGap: 20, // 图例项之间的间隔itemWidth: 20,itemHeight: 8,data: ['活动次数', '幼儿参与次数'], // 定义图例数据,与 series 中的 name 对应          },grid: {bottom: '30', // 图表距离底部的距离,这里设置为容器高度的30%containLabel: true // 是否包含坐标轴的刻度标签在内},xAxis: {type: 'category',data: that.info.classRecordDetail.classList,axisTick: {show: false //隐藏刻度线  },axisLabel: {rotate: 45,   // X轴文字向左倾斜45度fontSize: 10,formatter: function (params) {return that.filterFormatter(params)}}},yAxis: [{type: 'value',// 左侧柱状图的刻度值设置//min: 0,//max: 20,axisLabel: {formatter: '{value}',fontSize: 12}},{type: 'value',// 右侧折线图的刻度值设置//min: 0,//max: 100,splitLine: {show: true, // 显示分隔线lineStyle: {type: 'dashed' // 设置分隔线为虚线}},axisLabel: {formatter: '{value}',fontSize: 12},}],series: [{name: '活动次数',type: 'bar',barWidth: '50%', // 设置柱子宽度为相对于类目宽度的 50%barMaxWidth: '50',yAxisIndex: 0, // 指定使用第一个 Y 轴data: this.info.classRecordDetail.classRecordList,itemStyle: {// 设置柱状图颜色color: '#02a7f0',// 设置圆角borderRadius: [5, 5, 0, 0] // 左上、右上、右下、左下的圆角}},{name: '幼儿参与次数',type: 'line',yAxisIndex: 1, // 指定使用第二个 Y 轴data: this.info.classRecordDetail.classStudentList,symbol: 'none', // 去除拐角圈lineStyle: {color: '#f59a23', // 修改折线颜色为黄色}}]};this.classActivityDom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.classActivityDom.resize();});},//字数为8个超出就显示成点filterFormatter(params) {var index = 8;var newstr = '';for (var i = 0; i < params.length; i += index) {var tmp = params.substring(i, i + index);newstr += tmp + '';}if (newstr.length > 8)return newstr.substring(0, 8) + '..';elsereturn '\n' + newstr;},//多颜色环形图pieEcharts2(dom) {const container = document.getElementById(dom); // 获取容器元素this.activitydom = echarts.init(container); // 初始化echarts实例let odata = []if (this.info && this.info.classRecordDetail && this.info.classRecordDetail.classTagList && this.info.classRecordDetail.classTagList.length > 0) {odata = this.info.classRecordDetail.classTagList}let option = {tooltip: {trigger: 'item'},legend: {bottom: '0',left: 'center',itemWidth: 20,itemHeight: 8,},series: [{name: '',type: 'pie',center: ['50%', '50%'],radius: ['30%', '50%'], //第一个参数和第二个参数的区间就是圆环的宽度avoidLabelOverlap: false,itemStyle: {borderRadius: 10,borderColor: '#fff',borderWidth: 1},label: {show: false,position: 'center'},// emphasis: {//   label: {//     show: true,//     fontSize: 40,//     fontWeight: 'bold'//   }// },labelLine: {show: false},data: odata}]};this.activitydom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.activitydom.resize();});},//简单环形图pieEcharts(dom, completionRate) {const container = document.getElementById(dom); // 获取容器元素this.chartdom = echarts.init(container); // 初始化echarts实例let correctRate = completionRatelet errorRate = 100 - completionRatevar option = {tooltip: {show: false,trigger: 'item',formatter: "{a} : {c} ({d}%)"},title: {text: correctRate + '%',  //图形标题,配置在中间对应效果图的80%left: "center",top: "35%",textStyle: {color: "#02a7f0",fontSize: 16,align: "center"}},series: [{type: 'pie',radius: ['86%', '98%'],  //设置内外环半径,两者差值越大,环越粗hoverAnimation: false,  //移入图形是否放大label: {     //对应效果图中的Angular显示与否以及设置样式// show: true,// position: 'center',normal: {show: true,position: 'center',padding: [0, 0, 20, 0],  //设置字angular的边距fontSize: 16,}},labelLine: {normal: {  //label线不显示show: false}},data: [{value: correctRate,  //对应显示的部分数据即80%itemStyle: {normal: {color: '#02a7f0',}}},{value: errorRate,itemStyle: {normal: {color: '#edeef0'}}}]}]};this.chartdom.setOption(option);//随着屏幕大小调节图表//myChart.resize();window.addEventListener('resize', () => {this.chartdom.resize();});},goTarget(href) {window.open(href, "_blank");},}
};
</script>
<style scoped>
.title-common-left{ display: flex; align-items: center;}
.icon-20{ margin-right: 10px; display: block; width: 20px;}
.title-common-right {display: flex;align-items: center;
}.width-big {margin-top: 10px;width: 100%;
}.activity-class-rig {flex: 1
}.jc-sb {justify-content: space-between;
}.flex-box {display: flex;
}.student-mes .d1 {margin-left: 6px;flex: 1;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
}.student-mes {display: flex;align-items: center;
}.student-img {display: block;width: 36px;height: 36px;
}.activity-teacher {margin-top: 10px;font-size: 12px;
}.activity-class {padding: 10px 15px;box-sizing: border-box;flex: 1;border: 1px solid #ddd;
}.activity-plan {margin-right: 10px;padding: 10px 15px;box-sizing: border-box;width: 450px;border: 1px solid #ddd;
}.activty-box {margin-top: 10px;display: flex;
}.pie-box {display: flex;flex-direction: column;align-items: center;
}.pie-box .d2 {margin-top: 6px;font-size: 12px;
}.tpc-rig-list .d1 {font-size: 16px;font-weight: bold;
}.tpc-rig-list {margin-bottom: 10px;text-align: center;
}.tpc-rig-list:last-child {margin-bottom: 0;
}.tpc-rig {display: flex;flex-direction: column;justify-content: space-evenly;
}.teach-plan-cont {padding-top: 5px;justify-content: space-between;
}.tpc-lef,
.tpc-rig {min-height: 80px;
}.tpc-lef {display: flex;flex-direction: column;justify-content: space-evenly;
}.tpc-lef-list .d2 {margin-left: 10px;
}.tpc-lef-list {align-items: center;
}.teach-plan-cont,
.tpc-lef-list {display: flex;
}.teach-plan {margin-right: 10px;padding: 10px 15px;box-sizing: border-box;flex: 1;border: 1px solid #ddd;
}.teach-plan:last-child {margin-right: 0;
}.statistical-main {margin-top: 10px;display: flex;
}.title-common {display: flex;justify-content: space-between;align-items: center;
}.wrap {padding: 20px;font-size: 14px;
}.home {margin-top: 10px;display: flex;justify-content: center;align-items: center;
}.home img {width: 82%;
}
</style>

主打一个原滋原味 有需要的自己翻

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/751077.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MongoDB从0到1:高效数据使用方法

MongoDB&#xff0c;作为一种流行的NoSQL数据库。从基础的文档存储到复杂的聚合查询&#xff0c;从索引优化到数据安全都有其独特之处。文末附MongoDB常用命令大全。 目录 1. 引言 MongoDB简介 MongoDB的优势和应用场景 2. 基础篇 安装和配置MongoDB MongoDB基本概念 使…

Win10 无法安装微软1月安全更新,出现 0x80070643 错误

出现这个问题的原因在于系统分配的“恢复分区”空间不足&#xff0c;该更新在安装时会失败。大致的思路是利用dispart工具收缩C盘空间&#xff0c;扩展该分区的空间。本人开始的“恢复分区”的空间是603MB&#xff0c;安装更新失败&#xff0c;扩充了250MB后&#xff0c;成功了…

基于springboot+mybatis调用MySQL存储过程

前言&#xff1a; 很多公司一般不使用JAVA写存储过程&#xff0c;因为写法较为复杂&#xff0c;不方便后期维护。 不排除一些公司项目会使用。 如果索引优化已经达到很好的性能&#xff0c;不建议使用。以下示例供学习参考&#xff1a; demo源码&#xff1a;https://gitee.com…

一文彻底搞懂进程间通信方式

文章目录 1. 进程间通信的概念2. 进程间通信的7种方式2.1 管道/匿名管道(pipe)2.2 有名管道(FIFO)2.3 信号(Signal)2.4 消息(Message)队列2.5 共享内存(share memory)2.6 信号量(semaphore)2.7 套接字(socket) 1. 进程间通信的概念 每个进程各自有不同的用户地址空间&#xff…

由浅到深认识C语言(14):枚举

该文章Github地址&#xff1a;https://github.com/AntonyCheng/c-notes 在此介绍一下作者开源的SpringBoot项目初始化模板&#xff08;Github仓库地址&#xff1a;https://github.com/AntonyCheng/spring-boot-init-template & CSDN文章地址&#xff1a;https://blog.csdn…

操作系统系列学习——进程同步与信号量

文章目录 前言进程同步与信号量 前言 一个本硕双非的小菜鸡&#xff0c;备战24年秋招&#xff0c;计划学习操作系统并完成6.0S81&#xff0c;加油&#xff01; 本文总结自B站【哈工大】操作系统 李治军&#xff08;全32讲&#xff09; 老师课程讲的非常好&#xff0c;感谢 【哈…

存内领域前沿,基于忆阻器的存内计算----浅析忆阻存内计算

目录 一.概念浅析 1.存内计算 2.忆阻器 3.基于忆阻器的存内计算 二.忆阻器的分类 1.磁效应忆阻器 2 .相变效应忆阻器 3 .阻变效应忆阻器 三.基于忆阻器的存内计算原理 1. 利用二值忆阻器的布尔计算 3.1R-R 逻辑运算 3.2V-R 逻辑运算 3.3V-V 逻辑运算 2. 利用模拟…

GPU密集型计算性能优化的方法和技术

对GPU密集型计算进行性能优化的方法和技术多种多样。通过一些优化策略和技术需要综合考虑应用程序的具体需求、所使用的GPU硬件、以及编程模型和库的选择。通过不断地分析和调整&#xff0c;可以实现GPU计算性能的持续提升。以下是一些常用的优化策略和技术&#xff1a; 算法优…

Nacos注册中心与配置管理

Nacos注册中心与配置管理 1 Nacos注册中心1.1.认识Nacos1.2.服务注册到nacos1.3.服务分级存储模型1.4.权重配置1.5.环境隔离1.6.Nacos与Eureka的区别 2 CAP3.Nacos配置管理3.1.统一配置管理3.2.bootstrap了解3.3.配置热更新3.4.配置共享 1 Nacos注册中心 1.1.认识Nacos 国内公…

main方法语法

main方法语法 深入理解main方法main特别说明在idea中main动态传值 深入理解main方法 解释 main 方法的形式&#xff1a;public static void main&#xff08;String[ ] args&#xff09;{ } 1) main 方法时虚拟机调用&#xff1b; 2) java虚拟机需要调用类的 main() 方法&…

免费开源:自动会议记录接口调用|语音识别接口|语音识别API

一、开源项目介绍 一款多模态AI能力引擎&#xff0c;专注于提供自然语言处理&#xff08;NLP&#xff09;、情感分析、实体识别、图像识别与分类、OCR识别和语音识别等接口服务。该平台功能强大&#xff0c;支持本地化部署&#xff0c;并鼓励用户体验和开发者共同完善&#xf…

【Linux】进程间通信2(共享内存||消息队列)

共享内存 介绍 1.共享内存区是最快的IPC形式。一旦这样的内存映射到共享它的进程的地址空间&#xff0c;这些进程间数据传递不再涉及到内核&#xff0c;换句话说是进程不再通过执行进入内核的系统调用来传递彼此的数据。 2.当共享内存创建出来后&#xff0c;通过系统调用挂接到…

Java实现简单的通讯录

每日一言 泪眼问花花不语&#xff0c;乱红飞过秋千去。 —欧阳修- 简单的通讯录实现&#xff0c;跟写Java实现图书管理系统差不多&#xff0c;用到的知识也差不多&#xff0c;就当个小练习&#xff0c;练习一下写Java程序的手感。 Java实现图书管理系统 关于通讯录的代码都写…

Visio 去掉图形四周的空白区域(页边距)

1&#xff0c;打开自定义功能区 [文件]->[选项]->[自定义功能区] 2,打开设置页边距设置界面 点击之后再上方输入框进行修改&#xff0c;点击对钩进行确认修改&#xff0c;修改PageLeftMargin、PageRightMargin、PageTopMargin和PageBottomMargin这四个参数。

简历信息泄露?如何用图数据库技术解决简历泄露事件的反欺诈挑战

“金三银四”&#xff0c;又到了春招黄金期&#xff0c;但个人简历泄露的数据安全问题诸见报端&#xff0c;甚至在此前的3.15晚会报道中就揭露过招聘平台上的简历信息被泄露&#xff0c;不法分子通过各种渠道获取到简历&#xff0c;并用于欺诈活动&#xff0c;形成了一套庞大的…

wifi的5G和3GPP的5G

wifi 5G 跑的是802.11的协议。 wifi的5G指的就是频率&#xff0c;例如wifi2.4G&#xff0c;其频段处于2.400GHz~2.4835GHz之间&#xff0c;wifi5G的频率范围为5.15GHz到5.875GHz&#xff0c;其中包括多个频道。 这里有个误区&#xff0c;并不是运行在5GHz频段的WI-FI就是5G …

java过滤器Filter相关知识点汇总

1.Filter概述 Servlet Filter又称Servlet过滤器&#xff0c;它是在Servlet2.3规范中定义的&#xff0c;能够对Servlet容器传给Web资源的request对象和response对象执行检查和修改。 Filter不是Servlet&#xff0c;不能直接访问&#xff0c;其本身也不能生成request对象和resp…

很好的一本书,推荐给你们《Hello 算法》

算法犹如美妙的交响乐&#xff0c;每一行代码都像韵律般流淌。 愿这本书在你的脑海中轻轻响起&#xff0c;留下独特而深刻的旋律。 本项目旨在打造一本开源免费、新手友好的数据结构与算法入门教程。 全书采用动画图解&#xff0c;内容清晰易懂、学习曲线平滑&#xff0c;引导…

子组件自定义事件$emit实现新页面弹窗关闭之后父界面刷新

文章目录 需求弹窗关闭之后父界面刷新展示最新数据 实现方案AVUE 大文本默认展开slotVUE 自定义事件实现 父界面刷新那么如何用呢? 思路核心代码1. 事件定义2. 帕斯卡命名组件且在父组件中引入以及注册3. 子组件被引用与父事件监听4.父组件回调函数 5.按钮弹窗事件 需求 弹窗…

HCIP—OSPF虚链路实验

OSPF虚链路—Vlink 作用&#xff1a;专门解决OSPF不规则区域所诞生的技术&#xff0c;是一种虚拟的&#xff0c;逻辑的链路。实现非骨干区域和骨干区域在逻辑上直接连接。注意虚链路条件&#xff1a;只能穿越一个区域&#xff0c;通常对虚链路进行认证功能的配置。虚链路认证也…