|
|
@@ -1,8 +1,9 @@
|
|
|
<!-- 饼状图 -->
|
|
|
- <script lang="ts" setup>
|
|
|
+<script lang="ts" setup>
|
|
|
import * as echarts from 'echarts'
|
|
|
import { useThemeStore } from '@/stores/modules/theme'
|
|
|
import { onMounted, ref, reactive, watch, computed } from 'vue'
|
|
|
+import { formatNumber } from '@/utils/tools'
|
|
|
const props = defineProps({
|
|
|
PieData: Object
|
|
|
})
|
|
|
@@ -83,7 +84,7 @@ const initOption: any = reactive({
|
|
|
params.marker +
|
|
|
params.percent +
|
|
|
'% (' +
|
|
|
- params.value +
|
|
|
+ formatNumber(params.value) +
|
|
|
')</div>'
|
|
|
return str
|
|
|
}
|
|
|
@@ -114,7 +115,10 @@ const initOption: any = reactive({
|
|
|
label: {
|
|
|
show: true,
|
|
|
// formatter: '{d}%({c})',
|
|
|
- formatter: '{name|{d}%}\n{time|({c})}',
|
|
|
+ formatter: (params) => {
|
|
|
+ console.log(params, 'params')
|
|
|
+ return `{name|${params.percent}%}\n {time|(${formatNumber(params.value)})}`
|
|
|
+ },
|
|
|
alignTo: 'labelLine',
|
|
|
rich: {
|
|
|
name: {
|