1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

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

Refs #4647
This commit is contained in:
ssongliu 2024-04-23 18:00:10 +08:00 committed by GitHub
parent 4596f9c2c2
commit 15b1f28fb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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