|
@@ -20,22 +20,41 @@ export default {
|
|
|
data: [],
|
|
|
},
|
|
|
option: {
|
|
|
+ title: {
|
|
|
+ text: '课程数量',
|
|
|
+ textStyle:{
|
|
|
+ fontSize: 12,
|
|
|
+ marginLeft: 12
|
|
|
+ },
|
|
|
+ padding: [5, 0, 0, 10]
|
|
|
+ },
|
|
|
tooltip: {
|
|
|
trigger: 'item'
|
|
|
},
|
|
|
series: [
|
|
|
{
|
|
|
+ avoidLabelOverlap: true, //是否启用防止标签重叠策略
|
|
|
+ labelLine: { // 设置指示线的长度
|
|
|
+ length: 8,
|
|
|
+ length2: 5
|
|
|
+ },
|
|
|
+ label: {
|
|
|
+ fontSize: 12,
|
|
|
+ position:'outer',
|
|
|
+ // alignTo:'labelLine'
|
|
|
+ },
|
|
|
+ labelLayout: {
|
|
|
+ hideOverlap: false
|
|
|
+ },
|
|
|
type: 'pie',
|
|
|
radius: ['35%', '70%'],
|
|
|
- avoidLabelOverlap: false,
|
|
|
emphasis: {
|
|
|
label: {
|
|
|
show: true,
|
|
|
- fontSize: 16,
|
|
|
+ fontSize: 13,
|
|
|
fontWeight: 'bold'
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
data: [
|
|
|
// { value: 1048, name: '一年级' },
|
|
|
// { value: 735, name: '二年级' },
|
|
@@ -64,7 +83,7 @@ export default {
|
|
|
this.option.series[0].data = this.ooption.data.filter(item => item.value !== 0);
|
|
|
chartObj.off('click')
|
|
|
let _this = this
|
|
|
- chartObj.on('click', function (param) {
|
|
|
+ chartObj.on('click', function (param) {
|
|
|
//param参数包含的内容有:
|
|
|
//param.name:X轴的值
|
|
|
//param.data:Y轴的值
|
|
@@ -75,7 +94,7 @@ export default {
|
|
|
//param.dataIndex:数值序列(X轴上当前点是第几个点)
|
|
|
//alert(param.seriesName); //legend的名称
|
|
|
console.log(param); //X轴的值
|
|
|
- _this.$emit('openCourse',param.dataIndex)
|
|
|
+ _this.$emit('openCourse', param.dataIndex)
|
|
|
});
|
|
|
// 初始化雷达图
|
|
|
this.chartObj = chartObj;
|
|
@@ -87,7 +106,7 @@ export default {
|
|
|
data: [],
|
|
|
}
|
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
- this.ooption.data.push({ value: array[i].course, name: array[i].name})
|
|
|
+ this.ooption.data.push({ value: array[i].course, name: array[i].name })
|
|
|
}
|
|
|
if (!this.chartObj) {
|
|
|
this.setChart(this.ooption);
|