123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <template>
- <div class="annulus_box">
- <div class="annulus_title"><p>及格率比较</p></div>
- <div id="pie_duo" style="width:99%; height:450px;"></div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
-
- }
- },
- created() {
- this.init();
- },
- computed: {
- annulus() {
- return this.$store.state.annulus
- },
- },
- methods: {
- drawLine(obj) {
- let title = '';
- let num = '';
- console.log(title,456789)
- var dataStyle = {
- normal: {
- label: { show: false },
- labelLine: { show: false },
- // shadowBlur: 40,
- shadowColor: 'rgba(40, 40, 40, 0.5)',
- }
- };
- let myChart_lei = this.$echarts.init(document.getElementById('pie_duo'));
- myChart_lei.setOption({
- title:{
- text:title ,
- subtext: this.num,
- x:'center',
- y:'35%',
- itemGap: 0,
- textStyle: {
- fontSize: 28,
- fontWeight: 'bolder',
- color: '#000080'
- },
- //subtextStyle: {
- // fontSize: 19,
- // fontWeight: 'bolder',
- // color: '#333'
- //},
-
- },
- backgroundColor: '#fff',
- color: obj.primarycolor,
- tooltip: {
- show: true,
- position: ['33%', '41%'],
- fontSize:'30',
- formatter: function (value) {
- var res = '<div style="text-align:center;width:120px;"><p style="font-size:16px;">' + value.name + '</p></div>' + '<br/>' +
- '<div style="text-align:center;width:120px;"><p style="color:#00FFFF;font-size:20px;">' + value.value + '%' + '</p></div>'
- return res;
- },
- },
- legend: {
- show: false,
- itemGap: 12,
- top: '0%',
- right: '4%',
- data: obj.title
- },
- toolbox: {
- show: false,
- feature: {
- mark: { show: true },
- dataView: { show: true, readOnly: false },
- restore: { show: true },
- saveAsImage: { show: true }
- }
- },
- series: [
- {
- name: obj.areadata.dataname,
- type: 'pie',
- clockWise: true,
- radius: ['75%', '90%'],
- itemStyle: dataStyle,
- hoverAnimation: false,
- data: [
- {
- value: obj.areadata.occupydata,
- name: '本区及格率'
- },
- {
- value: obj.areadata.remaindata,
- name: '本区未及格率',
- itemStyle: {
- normal: {
- color: '#BFEFFF',
- }
- }
- },
- ]
- },
- {
- name: obj.schooldata.dataname,
- type: 'pie',
- clockWise: true,
- hoverAnimation: false,
- radius: ['60%', '75%'],
- itemStyle: dataStyle,
- data: [
- {
- value: obj.schooldata.occupydata,
- name: '本校及格率'
- },
- {
- value: obj.schooldata.remaindata,
- name: '本校未及格率',
- itemStyle: {
- normal: {
- color: '#B2DFEE',
- }
- }
- }
- ]
- },
- {
- name: obj.teachingdata.dataname,
- type: 'pie',
- clockWise: true,
- hoverAnimation: false,
- radius: ['45%', '60%'],
- itemStyle: dataStyle,
- data: [
- {
- value: obj.teachingdata.occupydata,
- name: '任教班及格率'
- },
- {
- value: obj.teachingdata.remaindata,
- name: '任教班未及格率',
- itemStyle: {
- normal: {
- color: '#F2F2F2',
- }
- }
- }
- ]
- },
- ]
- })
- },
- init() {
- this.$api.FindTeachAnnulus({})
- .then((response) => {
- //console.log(response.result.data, 777777)
- this.$store.state.annulus = response.result.data
- })
- },
- },
- watch: {
- // 监听指令
- annulus(a) {
- this.drawLine(a)
- },
- }
- }
- </script>
- <style scoped>
- .annulus_box {
- width:100%;
- height:450px;
- }
- .annulus_title {
- width:100%;
- font-size:18px;
- font-weight:bold;
- color:#333;
- padding-left:3%;
- padding-top:1%;
-
- }
- </style>
|