This commit is contained in:
duanliang
2025-04-24 21:13:54 +08:00
parent f01789286e
commit 0312549427
3 changed files with 34 additions and 23 deletions

View File

@@ -9,12 +9,13 @@ export function useEchart() {
const initChart = () => {
const dom = document.getElementById(id.value)
chart = echarts.init(dom)
chartVal.value = chart
}
const setOption = (params, update = false) => {
initChart()
chart.setOption(params, update)
}
const clearOption = () => {
console.log('clearooooooooooooooooo')
// 将series设置为空数组可以清空图表内容
chart.setOption({
series:[]