forked from github/dataease
refactor(图表): 减少重复渲染
This commit is contained in:
parent
9e735af86a
commit
3d7dbbaa1a
@ -233,7 +233,10 @@ const renderChart = async (view, callback?) => {
|
||||
}
|
||||
}
|
||||
let myChart = null
|
||||
let g2Timer: number
|
||||
const renderG2Plot = async (chart, chartView: G2PlotChartView<any, any>) => {
|
||||
g2Timer && clearTimeout(g2Timer)
|
||||
g2Timer = setTimeout(async () => {
|
||||
try {
|
||||
myChart?.destroy()
|
||||
myChart = await chartView.drawChart({
|
||||
@ -251,6 +254,7 @@ const renderG2Plot = async (chart, chartView: G2PlotChartView<any, any>) => {
|
||||
} catch (e) {
|
||||
console.error('renderG2Plot error', e)
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
|
||||
const dynamicAreaId = ref('')
|
||||
|
Loading…
Reference in New Issue
Block a user