diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index 7e16b4037..bfbde26d4 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -17732,7 +17732,7 @@ }, "node-sass": { "version": "4.14.1", - "resolved": "https://registry.npmmirror.com/node-sass/-/node-sass-4.14.1.tgz", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { @@ -24364,7 +24364,7 @@ }, "webpack-bundle-analyzer": { "version": "2.13.1", - "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", "integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==", "dev": true, "requires": { diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index 85bf41bf8..4a4578d8f 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -876,3 +876,155 @@ height: auto !important; } } + +.bar-item { + &:last-of-type{ + margin: 0 !important; + } +} + +.bar-basic-vertical{ + width: 100%; + height: 100%; + display: flex; + overflow: hidden; + .bar-rect{ + border-radius: 2px; + background: $--chart-bar-background; + display: flex; + flex-direction: column; + justify-content: flex-end; + .bar-actual{ + border-radius: 2px; + } + } + .bar-value{ + display: flex; + justify-content: center; + align-items: center; + white-space: nowrap; + line-height: 1; + color: $--color-text-primary; + } + .bar-title{ + width: 100%; + font-size: 14px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-align: center; + line-height: 1.5; + color: $--color-text-primary; + } +} + + +.bar-basic-horizontal{ + width: 100%; + height: 100%; + overflow: hidden; + .bar-item{ + display: flex; + align-items: center; + overflow: hidden; + } + .bar-rect{ + border-radius: 2px; + background: $--chart-bar-background; + .bar-actual{ + border-radius: 2px; + } + } + .bar-title{ + padding-right: 10px; + box-sizing: border-box; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: right; + color: $--color-text-primary; + } + .bar-value{ + padding: 0 10px; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-end; + white-space: nowrap; + color: $--color-text-primary; + } +} + +.bar-retro-vertical{ + width: 100%; + height: 100%; + display: flex; + overflow: hidden; + .bar-item{ + display: flex; + overflow: hidden; + flex-direction: column-reverse; + } + .bar-rect{ + display: flex; + flex-direction: column-reverse; + align-items: center; + .bar-cell{ + border-radius: 2px; + } + } + .bar-value{ + display: flex; + justify-content: center; + align-items: center; + white-space: nowrap; + line-height: 1; + color: $--color-text-primary; + } + .bar-title{ + width: 100%; + font-size: 14px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-align: center; + line-height: 1.5; + color: $--color-text-primary; + } +} + +.bar-retro-horizontal{ + width: 100%; + height: 100%; + overflow: hidden; + .bar-item{ + display: flex; + align-items: center; + overflow: hidden; + .bar-rect{ + display: flex; + align-items: center; + .bar-cell{ + border-radius: 2px; + } + } + } + .bar-title{ + padding-right: 10px; + box-sizing: border-box; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: right; + color: $--color-text-primary; + } + .bar-value{ + padding: 0 10px; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-end; + white-space: nowrap; + color: $--color-text-primary; + } +} \ No newline at end of file diff --git a/nezha-fronted/src/assets/css/themes/theme-dark.scss b/nezha-fronted/src/assets/css/themes/theme-dark.scss index 0ddef4241..42baa5488 100644 --- a/nezha-fronted/src/assets/css/themes/theme-dark.scss +++ b/nezha-fronted/src/assets/css/themes/theme-dark.scss @@ -261,6 +261,7 @@ $--chart-border-color: $--border-color-light; $--chart-title-hover-background-color: #323238; $--chart-box-border-color: $--border-color-light; $--chart-shadow: -1px 0 8px -3px rgba(0,0,0,0.8); +$--chart-bar-background: #2D2E35; /* 14.popover */ $--popover-background-color: $--background-color-empty; diff --git a/nezha-fronted/src/assets/css/themes/theme-light.scss b/nezha-fronted/src/assets/css/themes/theme-light.scss index 268fe1ab8..f8b401aca 100644 --- a/nezha-fronted/src/assets/css/themes/theme-light.scss +++ b/nezha-fronted/src/assets/css/themes/theme-light.scss @@ -258,6 +258,7 @@ $--chart-border-color: $--color-text-label; $--chart-title-hover-background-color: $--background-color-1; $--chart-box-border-color: $--border-color-light; $--chart-shadow: -1px 0 8px -3px #ccc; +$--chart-bar-background: #F4F5F5; /* 14.popover */ $--popover-background-color: $--color-text-label; diff --git a/nezha-fronted/src/components/chart/chart/chartBar.vue b/nezha-fronted/src/components/chart/chart/chartBar.vue index 25c719b94..9a9cfb543 100644 --- a/nezha-fronted/src/components/chart/chart/chartBar.vue +++ b/nezha-fronted/src/components/chart/chart/chartBar.vue @@ -1,19 +1,265 @@ - - + + + + + + + + + + {{item.alias}} + + + + + + + + + + + + + {{item.mapping ? handleDisplay(item.mapping.display, { ...item.label, value: item.showValue }) : item.showValue}} + + + + + + + + + + {{item.alias}} + + + + + + + + + + + + {{item.mapping ? handleDisplay(item.mapping.display, { ...item.label, value: item.showValue }) : item.showValue}} + + + + + + + + + + + + + + {{item.alias}} + + + + + + + + + {{item.mapping ? handleDisplay(item.mapping.display, { ...item.label, value: item.showValue }) : item.showValue}} + + + + + + + + + + + + + {{item.mapping ? handleDisplay(item.mapping.display, { ...item.label, value: item.showValue }) : item.showValue}} + + + + + + + {{item.alias}} + + + + + + + + + {{tooltip.title}} + + + value + + + + + {{tooltip.value}} + + + {{toolbox.title}} @@ -40,25 +286,22 @@ + +
+ {{item.alias}} +
+ + {{item.mapping ? handleDisplay(item.mapping.display, { ...item.label, value: item.showValue }) : item.showValue}} +
{{item.alias}}