Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

fix: prevent chart tooltip cutoff in dashboard widgets (#3060)

amanjain57-gif425ac22adde7
diff --git a/ui/component/or-attribute-barchart/src/index.ts b/ui/component/or-attribute-barchart/src/index.ts
index effca2b43..868cc66fd 100644
--- a/ui/component/or-attribute-barchart/src/index.ts
+++ b/ui/component/or-attribute-barchart/src/index.ts
@@ -1446,7 +1446,9 @@ export class OrAttributeBarChart extends LitElement {
backgroundColor: this._style.getPropertyValue("--internal-or-asset-tree-background-color"),
tooltip: {
trigger: "axis",
- confine: true, // make tooltip not go outside frame bounds
+ appendTo: "body",
+ confine: true,
+ extraCssText: "white-space: normal; word-wrap: break-word;",
axisPointer: {
type: "cross",
label: {
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.ts
index bc59c6c13..bbdfa81f5 100644
--- a/ui/component/or-attribute-history/src/index.ts
+++ b/ui/component/or-attribute-history/src/index.ts
@@ -530,7 +530,9 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
backgroundColor: this._style.getPropertyValue("--internal-or-asset-viewer-panel-color"),
tooltip: {
trigger: "axis",
+ appendTo: "body",
confine: true,
+ extraCssText: "white-space: normal; word-wrap: break-word;",
axisPointer: { type: "cross" },
formatter: (params: any) => {
if (Array.isArray(params) && params.length > 0) {
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.ts
index 8fd773470..ca0e9190b 100644
--- a/ui/component/or-chart/src/index.ts
+++ b/ui/component/or-chart/src/index.ts
@@ -627,7 +627,9 @@ export class OrChart extends translate(i18next)(LitElement) {
backgroundColor: this._style.getPropertyValue("--internal-or-asset-tree-background-color") || "#FFFFFF",
tooltip: {
trigger: "axis",
+ appendTo: "body",
confine: true,
+ extraCssText: "white-space: normal; word-wrap: break-word;",
axisPointer: {
type: "cross",
},