|
|
<template>
|
|
|
<div :style="styleObj" class="percentContainer">
|
|
|
<div class="percent-item" :style="percentItemStyle" v-for="item in percentData">
|
|
|
<v-chart :options="item.options" autoresize/>
|
|
|
<div class="chart-title" :style="titleStyle">{{ item.name }}</div>
|
|
|
<div :style="styleObj" class="">
|
|
|
<div class="percent-title" :style="titleStyle">
|
|
|
<img :src="imgStyle.imageAdress" alt="" class="icon-title">
|
|
|
{{ optionsSetup.titleName }}
|
|
|
</div>
|
|
|
<div class="percentContainer" :style="flexStyle">
|
|
|
<div class="percent-item" :style="percentItemStyle" v-for="item in percentData">
|
|
|
<v-chart :options="item.options" autoresize/>
|
|
|
<div class="chart-title" :style="subTitleStyle">{{ item.name }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
|
...
|
...
|
@@ -127,9 +134,14 @@ export default { |
|
|
left: this.optionsStyle.left + "px",
|
|
|
top: this.optionsStyle.top + "px",
|
|
|
background: this.optionsSetup.background,
|
|
|
'flex-flow':this.optionsSetup.flexFlow
|
|
|
};
|
|
|
},
|
|
|
flexStyle(){
|
|
|
return{
|
|
|
'flex-flow':this.optionsSetup.flexFlow
|
|
|
|
|
|
}
|
|
|
},
|
|
|
//环形图样式
|
|
|
percentItemStyle(){
|
|
|
let length=this.percentData.length;
|
...
|
...
|
@@ -141,14 +153,31 @@ export default { |
|
|
height: width + "px",
|
|
|
}
|
|
|
},
|
|
|
//下标题样式
|
|
|
//标题样式设置
|
|
|
titleStyle(){
|
|
|
return{
|
|
|
'display':this.optionsSetup.isTitle?'flex':'none',
|
|
|
'text-align':this.optionsSetup.textAlign,
|
|
|
'justify-content':this.optionsSetup.textAlign=='left'?'start':this.optionsSetup.textAlign=='center'?'center':'flex-end',
|
|
|
'font-size':this.optionsSetup.titleFontSize+'px',
|
|
|
color: this.optionsSetup.titleColor,
|
|
|
'font-weight': this.optionsSetup.titleFontWeight
|
|
|
}
|
|
|
},
|
|
|
//下标题样式
|
|
|
subTitleStyle(){
|
|
|
return{
|
|
|
'font-size':this.optionsSetup.textFontSize+'px',
|
|
|
color: this.optionsSetup.textColor,
|
|
|
'font-weight': this.optionsSetup.textFontWeight
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
//图片样式
|
|
|
imgStyle(){
|
|
|
return{
|
|
|
imageAdress:this.optionsSetup.imageAdress,
|
|
|
}
|
|
|
},
|
|
|
|
|
|
},
|
|
|
watch: {
|
...
|
...
|
@@ -419,4 +448,13 @@ export default { |
|
|
right:0;
|
|
|
bottom:20px;*/
|
|
|
}
|
|
|
.percent-title{
|
|
|
padding:5px;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
.icon-title{
|
|
|
margin-right:5px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|