You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
162 lines
3.6 KiB
162 lines
3.6 KiB
5 years ago
|
// @ts-ignore
|
||
|
import * as echarts from '../../../components/ec-canvas/echarts.js';
|
||
|
export function getNoProjectChart(data:any) {
|
||
|
return {
|
||
|
color: ["#FFC600", "#29B9A5"],
|
||
|
series: [{
|
||
|
label: {
|
||
|
normal: {
|
||
|
fontSize: 14
|
||
|
}
|
||
|
},
|
||
|
type: 'pie',
|
||
|
center: ['50%', '50%'],
|
||
|
radius: [0, '80%'],
|
||
|
data:data,
|
||
|
// roseType: 'area',
|
||
|
itemStyle: {
|
||
|
emphasis: {
|
||
|
shadowBlur: 10,
|
||
|
shadowOffsetX: 0,
|
||
|
shadowColor: 'rgba(0, 2, 2, 0.3)'
|
||
|
},
|
||
|
normal : {//去掉标示线
|
||
|
label : {
|
||
|
show : false
|
||
|
},
|
||
|
labelLine : {
|
||
|
show : false
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
}]
|
||
|
};
|
||
|
}
|
||
|
export function getNoProjectChart2(canvas:any, width:number, height:number,data:any,colorNoProject:any) {
|
||
|
const chart = echarts.init(canvas, null, {
|
||
|
width: width,
|
||
|
height: height
|
||
|
});
|
||
|
canvas.setChart(chart);
|
||
|
var option = {
|
||
|
color: colorNoProject,
|
||
|
series: [
|
||
|
{
|
||
|
name: '访问来源',
|
||
|
type: 'pie',
|
||
|
radius: ['50%', '70%'],
|
||
|
avoidLabelOverlap: false,
|
||
|
label: {
|
||
|
normal: {
|
||
|
show: false,
|
||
|
position: 'center'
|
||
|
},
|
||
|
emphasis: {
|
||
|
show: false,
|
||
|
textStyle: {
|
||
|
fontSize: '30',
|
||
|
fontWeight: 'bold'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
labelLine: {
|
||
|
normal: {
|
||
|
show: false
|
||
|
}
|
||
|
},
|
||
|
data: data,
|
||
|
}
|
||
|
]
|
||
|
};
|
||
|
|
||
|
chart.setOption(option);
|
||
|
return chart;
|
||
|
}
|
||
|
export function getProjectChart(canvas:any, width:number, height:number,data:any) {
|
||
|
const chart = echarts.init(canvas, null, {
|
||
|
width: width,
|
||
|
height: height
|
||
|
});
|
||
|
canvas.setChart(chart);
|
||
|
var option = {
|
||
|
color: ["#FFC600", "#29B9A5"],
|
||
|
series: [{
|
||
|
label: {
|
||
|
normal: {
|
||
|
fontSize: 14
|
||
|
}
|
||
|
},
|
||
|
type: 'pie',
|
||
|
center: ['50%', '50%'],
|
||
|
radius: [0, '80%'],
|
||
|
data:data,
|
||
|
// roseType: 'area',
|
||
|
itemStyle: {
|
||
|
emphasis: {
|
||
|
shadowBlur: 10,
|
||
|
shadowOffsetX: 0,
|
||
|
shadowColor: 'rgba(0, 2, 2, 0.3)'
|
||
|
},
|
||
|
normal : {//去掉标示线
|
||
|
label : {
|
||
|
show : false
|
||
|
},
|
||
|
labelLine : {
|
||
|
show : false
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
}]
|
||
|
};
|
||
|
|
||
|
chart.setOption(option);
|
||
|
return chart;
|
||
|
}
|
||
|
export function getProjectChart2(canvas:any, width:number, height:number,data:any,colorProject:any) {
|
||
|
const chart = echarts.init(canvas, null, {
|
||
|
width: width,
|
||
|
height: height
|
||
|
});
|
||
|
canvas.setChart(chart);
|
||
|
var option = {
|
||
|
color: colorProject,
|
||
|
grid:{
|
||
|
x:25,
|
||
|
y:45,
|
||
|
x2:5,
|
||
|
y2:20,
|
||
|
borderWidth:1
|
||
|
},
|
||
|
series: [
|
||
|
{
|
||
|
name: '访问来源',
|
||
|
type: 'pie',
|
||
|
radius: ['50%', '70%'],
|
||
|
avoidLabelOverlap: false,
|
||
|
label: {
|
||
|
normal: {
|
||
|
show: false,
|
||
|
position: 'center'
|
||
|
},
|
||
|
emphasis: {
|
||
|
show: false,
|
||
|
textStyle: {
|
||
|
fontSize: '30',
|
||
|
fontWeight: 'bold'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
labelLine: {
|
||
|
normal: {
|
||
|
show: false
|
||
|
}
|
||
|
},
|
||
|
data: data
|
||
|
}
|
||
|
]
|
||
|
};
|
||
|
|
||
|
chart.setOption(option);
|
||
|
return chart;
|
||
|
}
|