mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
37 lines
717 B
Vue
37 lines
717 B
Vue
<template>
|
|
<VChart theme="dark" :option="option" autoresize />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed, PropType } from 'vue'
|
|
import VChart from 'vue-echarts'
|
|
import { use, graphic } from 'echarts/core'
|
|
import { CanvasRenderer } from 'echarts/renderers'
|
|
import { PieChart } from 'echarts/charts'
|
|
import {
|
|
GridComponent,
|
|
TooltipComponent,
|
|
LegendComponent
|
|
} from 'echarts/components'
|
|
import config from './config'
|
|
|
|
const props = defineProps({
|
|
chartData: {
|
|
type: Object as PropType<config>,
|
|
required: true
|
|
}
|
|
})
|
|
|
|
use([
|
|
CanvasRenderer,
|
|
PieChart,
|
|
GridComponent,
|
|
TooltipComponent,
|
|
LegendComponent
|
|
])
|
|
|
|
const option = computed(() => {
|
|
return props.chartData.option
|
|
})
|
|
</script>
|