diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index e3094f8fd..3ab8caae0 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -507,6 +507,7 @@ font-weight: bold; } } + .endpoint-query-metrics.chart-fullscreen.nz-dialog,.recordRules-query-metrics.chart-fullscreen.nz-dialog { .chart-screen-header .chart-header__tools #browser-go { margin-left: 5px; @@ -683,8 +684,8 @@ } .chart-dataLink-tooltip{ - position: absolute; - padding-bottom: 2px; + position: absolute !important; + padding-bottom: 2px !important; z-index: 999999999; pointer-events: auto; .chart-dataLink-list{ @@ -717,6 +718,22 @@ } } +.chart-expolre-tooltip{ + display: block; + border-style: solid; + white-space: nowrap; + will-change: transform; + box-shadow: rgba(0, 0, 0, 0.2) 1px 2px 10px; + transition: opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s; + background-color: $--background-color-empty; + border-width: 1px; + border-radius: 4px; + color: rgb(0, 0, 0); + font: 14px / 21px "Microsoft YaHei"; + padding: 10px; + border-color: rgb(221, 228, 237); +} + .graph-icon-info-box{ position: absolute; top: 50%; @@ -854,4 +871,4 @@ .chart-canvas-tooltip{ height: auto !important; } -} \ No newline at end of file +} diff --git a/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss b/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss index 556aa7f1c..b61d18f2b 100644 --- a/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss +++ b/nezha-fronted/src/assets/css/components/page/dashboard/explore/explore.scss @@ -243,6 +243,7 @@ .chart-room { width: 100%; height: 300px; + position: relative; } .introduce-view { .info-room { diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 3069bb63a..c7282202a 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -174,6 +174,18 @@ export default { this.legends = [] this.series = chartOption.series = this.handleTimeSeries(this.chartInfo, chartOption.series[0], this.chartData) // 生成series和legends + const styleOption = this.$lodash.get(this.chartInfo, 'param.option') + if (styleOption) { + chartOption.series.forEach(item => { + if (item.lineStyle && styleOption.lineWidth != undefined) { + item.lineStyle.width = styleOption.lineWidth + } + if (styleOption.pointSize != undefined) { + item.symbolSize = styleOption.pointSize + } + }) + } + this.isGrey = this.legends.map(() => false) chartOption.color = this.colorList if (!this.series.length) { @@ -260,12 +272,11 @@ export default { if (this.tooltip.activeIndex != params.seriesIndex) { const option = myChart.getOption() option.series[params.seriesIndex].symbol = 'circle' - option.series[params.seriesIndex].emphasis.itemStyle = { - opacity: 1, + option.series[params.seriesIndex].itemStyle = { borderColor: this.hexToRgb(params.color, 0.4), - borderWidth: 6 + borderWidth: 5 } - myChart.setOption(option, true) + myChart.setOption(option) } } this.tooltip.activeIndex = params.seriesIndex @@ -275,11 +286,8 @@ export default { const option = myChart.getOption() option.series.forEach(item => { item.symbol = 'emptyCircle' - item.emphasis.itemStyle = { - opacity: 1 - } }) - myChart.setOption(option, true) + myChart.setOption(option) } this.tooltip.activeIndex = undefined }) diff --git a/nezha-fronted/src/components/chart/chart/legend.vue b/nezha-fronted/src/components/chart/chart/legend.vue index 0c9ffcea4..6968fee1c 100644 --- a/nezha-fronted/src/components/chart/chart/legend.vue +++ b/nezha-fronted/src/components/chart/chart/legend.vue @@ -129,11 +129,6 @@ export default { } }, methods: { - onCopy (txt) { - this.$copyText(txt).then(() => { - this.$message.success({ message: this.$t('overall.copySuccess') }) - }) - }, clickLegend (legendName, index) { /* 点击legend * 1.当前如果是全高亮状态,则全部置灰,只留被点击的legend高亮 diff --git a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js index c10ebc33b..65b859d54 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js +++ b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js @@ -152,26 +152,23 @@ export const chartTimeSeriesLineOption = { type: 'line', symbol: 'emptyCircle', // 去掉点 connectNulls: true, - symbolSize: [6, 6], + symbolSize: 6, smooth: 0.2, // 曲线变平滑 - // showSymbol: false, - itemStyle: { - opacity: 0.001 - }, + showSymbol: false, data: [], lineStyle: { width: 1, opacity: 0.9 }, emphasis: { - focus: 'series', - itemStyle: { - opacity: 1 - } + focus: 'series' }, blur: { lineStyle: { opacity: 0.3 + }, + itemStyle: { + opacity: 1 } } }], diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue index 1dd8abbcd..8402ae91d 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -250,7 +250,11 @@ export default { min: undefined, max: undefined }, - dataLink: [] + dataLink: [], + option: { + lineWidth: 1, + pointSize: 6 + } }, elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }], panel: '', @@ -433,14 +437,22 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined + if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point')) { + if (!this.chart.param.rightYAxis) { + this.chart.param.rightYAxis = { + elementNames: [], + style: 'line', + unit: 2, + label: '', + min: undefined, + max: undefined + } + } + if (!this.chart.param.option) { + this.chart.param.option = { + lineWidth: 1, + pointSize: 6 + } } } if (this.chart.type === 'stat') { @@ -480,14 +492,22 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined + if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point')) { + if (!this.chart.param.rightYAxis) { + this.chart.param.rightYAxis = { + elementNames: [], + style: 'line', + unit: 2, + label: '', + min: undefined, + max: undefined + } + } + if (!this.chart.param.option) { + this.chart.param.option = { + lineWidth: 1, + pointSize: 6 + } } } if (this.chart.type === 'stat') { diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index e968db0ab..f8831f022 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -447,8 +447,46 @@ + +