namnguyen 11 månader sedan
förälder
incheckning
cc67c5bd4f
2 ändrade filer med 6 tillägg och 10 borttagningar
  1. 6 5
      frontend/taipy-gui/src/components/Taipy/Metric.tsx
  2. 0 5
      taipy/gui/viselements.json

+ 6 - 5
frontend/taipy-gui/src/components/Taipy/Metric.tsx

@@ -50,7 +50,7 @@ interface MetricProps extends TaipyBaseProps, TaipyHoverProps {
     template_Light_?: string;
 }
 
-const emptyLayout = {} as Record<string, Record<string, unknown>>;
+const emptyLayout = {} as Partial<Layout>;
 const defaultStyle = {position: "relative", display: "inline-block"};
 
 const Metric = (props: MetricProps) => {
@@ -145,10 +145,11 @@ const Metric = (props: MetricProps) => {
             layout.template = template;
         }
 
-        return {
-            title: props.title || layout.title,
-            ...layout
-        } as Partial<Layout>
+        if (props.title) {
+            layout.title = props.title;
+        }
+
+        return layout as Partial<Layout>;
     }, [
         props.title,
         props.template,

+ 0 - 5
taipy/gui/viselements.json

@@ -1198,11 +1198,6 @@
                         "name": "template[light]",
                         "type": "dict",
                         "doc": "The Plotly <a href=\"https://plotly.com/javascript/layout-template/\">layout template</a> applied over the base template when theme is not dark."
-                    },
-                    {
-                        "name": "hover_text",
-                        "type": "dynamic(str)",
-                        "doc": "The information that is displayed when the user hovers over this element."
                     }
                 ]
             }