fix: 解决概览页折线图选择失败的问题 (#4656)

Refs #4647
pull/4669/head
ssongliu 7 months ago committed by GitHub
parent 4596f9c2c2
commit 15b1f28fb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -83,7 +83,8 @@ const seriesStyle = [
function initChart() {
let itemChart = echarts?.getInstanceByDom(document.getElementById(props.id) as HTMLElement);
//
const optionItem = itemChart?.getOption();
const itemSelect = optionItem?.legend;
if (itemChart == null) {
itemChart = echarts.init(document.getElementById(props.id) as HTMLElement);
}
@ -109,10 +110,9 @@ function initChart() {
yAxis.push({
splitLine: {
show: true,
//线
lineStyle: {
type: 'dashed', //线 线0
opacity: theme === 'dark' ? 0.1 : 1, //
type: 'dashed',
opacity: theme === 'dark' ? 0.1 : 1,
},
},
...item,
@ -120,7 +120,6 @@ function initChart() {
});
}
//
const option = {
title: [
{
@ -168,7 +167,7 @@ function initChart() {
},
},
grid: props.option.grid || { left: '7%', right: '7%', bottom: '20%' },
legend: {
legend: itemSelect || {
right: 10,
itemWidth: 8,
textStyle: {

Loading…
Cancel
Save