|
|
@ -23,6 +23,9 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
setOption() {
|
|
|
|
setOption() {
|
|
|
|
|
|
|
|
let temp = this.getHeight();
|
|
|
|
|
|
|
|
let height = parseInt(temp / 5);
|
|
|
|
|
|
|
|
console.log(height);
|
|
|
|
let point = this.chartObj.point; //环形图的具体 百分比
|
|
|
|
let point = this.chartObj.point; //环形图的具体 百分比
|
|
|
|
let total = this.chartObj.total;
|
|
|
|
let total = this.chartObj.total;
|
|
|
|
|
|
|
|
|
|
|
@ -35,15 +38,9 @@ export default {
|
|
|
|
show: true, // 是否显示
|
|
|
|
show: true, // 是否显示
|
|
|
|
text: this.chartObj.name,
|
|
|
|
text: this.chartObj.name,
|
|
|
|
textStyle: { fontSize: 12, color: "#D0DEEE" },
|
|
|
|
textStyle: { fontSize: 12, color: "#D0DEEE" },
|
|
|
|
/* subtextStyle: {
|
|
|
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
|
|
|
fontWeight: 500,
|
|
|
|
|
|
|
|
lineHeight: 10,
|
|
|
|
|
|
|
|
color: "#E3FEFF",
|
|
|
|
|
|
|
|
}, */
|
|
|
|
|
|
|
|
textAlign: "center",
|
|
|
|
textAlign: "center",
|
|
|
|
left: "47%",
|
|
|
|
left: "47%",
|
|
|
|
top: 84,
|
|
|
|
top: 2 * height + 16,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
color: this.chartObj.color,
|
|
|
|
color: this.chartObj.color,
|
|
|
|
graphic: {
|
|
|
|
graphic: {
|
|
|
@ -52,12 +49,12 @@ export default {
|
|
|
|
type: "image",
|
|
|
|
type: "image",
|
|
|
|
style: {
|
|
|
|
style: {
|
|
|
|
image: this.chartObj.icon,
|
|
|
|
image: this.chartObj.icon,
|
|
|
|
width: 120,
|
|
|
|
width: 4 * height,
|
|
|
|
height: 120,
|
|
|
|
height: 4 * height,
|
|
|
|
zIndex: 1,
|
|
|
|
zIndex: 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
left: "center",
|
|
|
|
left: "center",
|
|
|
|
top: -15,
|
|
|
|
top: 8-height,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -65,8 +62,8 @@ export default {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// name: '访问来源1',
|
|
|
|
// name: '访问来源1',
|
|
|
|
type: "pie",
|
|
|
|
type: "pie",
|
|
|
|
radius: [25, 30],
|
|
|
|
radius: [height - 6, height],
|
|
|
|
center: ["center", 45],
|
|
|
|
center: ["center", height + 8],
|
|
|
|
data: [
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value: total, //对应显示的部分数据即100%
|
|
|
|
value: total, //对应显示的部分数据即100%
|
|
|
@ -92,29 +89,27 @@ export default {
|
|
|
|
// name: '访问来源2',
|
|
|
|
// name: '访问来源2',
|
|
|
|
type: "pie",
|
|
|
|
type: "pie",
|
|
|
|
showEmptyCircle: true, //是否在无数据的时候显示一个占位圆。
|
|
|
|
showEmptyCircle: true, //是否在无数据的时候显示一个占位圆。
|
|
|
|
radius: [25, 30],
|
|
|
|
radius: [height - 6, height],
|
|
|
|
center: ["center", 45],
|
|
|
|
center: ["center", height + 8],
|
|
|
|
avoidLabelOverlap: true, // 标签重叠时进行调整
|
|
|
|
avoidLabelOverlap: true, // 标签重叠时进行调整
|
|
|
|
data: [
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
value: total,
|
|
|
|
value: total,
|
|
|
|
itemStyle: {
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
borderRadius: 15, //圆角
|
|
|
|
borderRadius: 15, //圆角
|
|
|
|
color: {
|
|
|
|
color: {
|
|
|
|
// 设置渐变色
|
|
|
|
// 设置渐变色
|
|
|
|
type: "linear",
|
|
|
|
type: "linear",
|
|
|
|
colorStops: [
|
|
|
|
colorStops: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: this.chartObj.color[1], // 0% 处的颜色
|
|
|
|
color: this.chartObj.color[1], // 0% 处的颜色
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: this.chartObj.color[2], // 100% 处的颜色
|
|
|
|
color: this.chartObj.color[2], // 100% 处的颜色
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|