feat: 3d饼图修改

dev-deviceSetting
JINGYJ 1 year ago
parent b9c70c9fa1
commit 014d995868

@ -1,22 +1,25 @@
<template> <template>
<div <div style="width: 100%; height: 100%">
style="display: flex; justify-content: center; width: 100%; height: 278px" <vue-chart :option="chartOption" style="width: 100%; height: 100%" />
>
<div style="position: relative; width: 100%; height: 100%">
<!-- <img class="pie_img" :src="pieBg" alt="" /> -->
<vue-chart
:option="chartOption"
style="position: absolute; width: 100%; height: 100%"
/>
</div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import VueChart from "./VueChart.vue"; import VueChart from "./VueChart.vue";
// import * as echarts from "echarts"; // import * as echarts from "echarts";
import "echarts-gl"; import "echarts-gl";
import { computed } from "vue"; import { Ref, computed, ref, watch } from "vue";
// import pieBg from "@/assets/screen/pie_bg.png"; import { useAppStoreHook } from "@/store/modules/app";
import { EchartOptions, delay, useDark, useECharts } from "@pureadmin/utils";
const { isDark } = useDark();
const theme: EchartOptions["theme"] = computed(() => {
return isDark.value ? "dark" : "light";
});
const pieChartRef = ref<HTMLDivElement | null>(null);
const { resize } = useECharts(pieChartRef as Ref<HTMLDivElement>, {
theme
});
const props = defineProps({ const props = defineProps({
data: { data: {
@ -315,6 +318,13 @@ function getPie3D(pieData, internalDiameterRatio) {
const chartOption = computed(() => { const chartOption = computed(() => {
return getPie3D(props.data, 0); return getPie3D(props.data, 0);
}); });
watch(
() => useAppStoreHook().getSidebarStatus,
() => {
delay(600).then(() => resize());
}
);
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save