diff --git a/nezha-fronted/src/components/charts/chart-detail.vue b/nezha-fronted/src/components/charts/chart-detail.vue index 3e2d29edc..b7f67cb39 100644 --- a/nezha-fronted/src/components/charts/chart-detail.vue +++ b/nezha-fronted/src/components/charts/chart-detail.vue @@ -467,6 +467,7 @@ this.panelIdInner = panelId; this.data = chartItem; + console.log(detail); this.detail = detail; if (this.detail[0] && this.detail[0].type && this.detail[0].type == "endpointInfo") { //endpointInfo的小图表 this.$nextTick(() => { @@ -481,17 +482,19 @@ initChart(series) { series.forEach((item)=>{ item.areaStyle={ - // color: { - // type: 'linear', - // x: 0, - // y: 0, - // colorStops: [{ - // offset: 0, color: 'rgb(255, 158, 68)' // 0% 处的颜色 - // }, { - // offset: 1, color: 'rgb(255, 70, 131)' // 100% 处的颜色 - // }], - // global: false - // } + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [{ + offset: 0, color: 'rgb(35,191,154)' // 0% 处的颜色 + }, { + offset: 1, color: 'rgb(255, 255, 255)' // 100% 处的颜色 + }], + global: false + } } }); let option = { @@ -549,6 +552,9 @@ series: series }; let chart = echarts.init(document.querySelector("#littleChart")); + option.series.forEach((item)=>{ + item.lineStyle.color='rgb(35,191,154)'; + }) chart.setOption(option);//创建图表 } }, diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 1e2f7c1f4..63521452e 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1225,7 +1225,7 @@ } }, getEndpointInfoChartData(chartInfo) { - let detail = []; + let detail = [null,null]; this.$refs['editChart'+chartInfo.id][0].showLoad(); chartInfo.title = this.$t("project.chart.endpointInfo"); @@ -1274,7 +1274,7 @@ }); basicInfo.stateSeries = [series]; basicInfo.state = ""; - detail.push({title: this.$t("project.chart.basicTitle"), data: basicInfo, type: "endpointInfo"}); + detail[0]={title: this.$t("project.chart.basicTitle"), data: basicInfo, type: "endpointInfo"}; resolve(true); } } @@ -1303,7 +1303,7 @@ } }); }(); - detail.push({title: this.$t("overall.alert"), data: alerts}); + detail[1]={title: this.$t("overall.alert"), data: alerts}; resolve(true); } });