修改图表
This commit is contained in:
parent
2483f21a97
commit
824c82ddb0
@ -12,10 +12,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { ref, onMounted, onUnmounted, getCurrentInstance,watch,onUpdated } from 'vue'
|
import { ref, onMounted, onUnmounted, getCurrentInstance, watch, onUpdated } from 'vue'
|
||||||
const { proxy } = getCurrentInstance() as any;
|
const { proxy } = getCurrentInstance() as any;
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
let {t} = useI18n();
|
let { t } = useI18n();
|
||||||
let ringRef = ref();
|
let ringRef = ref();
|
||||||
let ringChart = null;
|
let ringChart = null;
|
||||||
const prop = defineProps({
|
const prop = defineProps({
|
||||||
@ -32,7 +32,7 @@ const init = () => {
|
|||||||
color: "#fff",
|
color: "#fff",
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
left:'center'
|
left: 'center'
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "item",
|
trigger: "item",
|
||||||
@ -50,26 +50,26 @@ const init = () => {
|
|||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "pie",
|
type: "pie",
|
||||||
radius: ["20%", "70%"],
|
radius: ["40%", "70%"],
|
||||||
center: ["50%", "45%"],
|
center: ["50%", "45%"],
|
||||||
avoidLabelOverlap: false,
|
avoidLabelOverlap: false,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: 5,
|
borderRadius: 10,
|
||||||
// borderColor: '#fff',
|
// borderColor: '#fff',
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
|
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
formatter(params) {
|
formatter(params) {
|
||||||
return `${params.name} \n${(params.value / prop.total * 100).toFixed(2)}%`
|
return `${params.name} \n${(params.value / prop.total * 100).toFixed(2)}%`
|
||||||
},
|
},
|
||||||
fontSize:20
|
fontSize: 20
|
||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
top:'20%',
|
top: '20%',
|
||||||
data: prop.data,
|
data: prop.data,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user