This commit is contained in:
GGJ
2024-01-05 16:32:18 +08:00
parent 1d4bc5d442
commit 1fe43e1d70
7 changed files with 533 additions and 229 deletions

View File

@@ -11,10 +11,10 @@ const chartRef = ref<HTMLDivElement>()
const props = defineProps(['options'])
let chart: echarts.ECharts | any = null
const resizeHandler = () => {
chart.getZr().painter.getViewportRoot().style.display = "none";
chart.getZr().painter.getViewportRoot().style.display = 'none'
requestAnimationFrame(() => {
chart.resize()
chart.getZr().painter.getViewportRoot().style.display = "";
chart.getZr().painter.getViewportRoot().style.display = ''
})
}
const initChart = () => {
@@ -28,7 +28,7 @@ const initChart = () => {
color: '#000',
fontSize: 18
},
...props.options.title
...(props.options.title || null)
},
tooltip: {
trigger: 'axis',
@@ -116,7 +116,7 @@ const initChart = () => {
opacity: 0.5
}
},
...(props.options.yAxis || null),
...(props.options.yAxis || null)
}
],
dataZoom: [
@@ -125,13 +125,15 @@ const initChart = () => {
height: 13,
start: 0,
bottom: '20px',
end: 100
end: 100,
...(props.options.dataZoom || null)
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100
end: 100,
...(props.options.dataZoom|| null)
}
],
color: [