dosubot[bot] commented on issue #36779: URL: https://github.com/apache/superset/issues/36779#issuecomment-3678706891
<!-- Answer --> You're right—there isn't a dedicated tooltip field in the deck.gl Polygon chart configuration. By default, tooltips show the polygon geometry (from the "Polygon" column), the metric, and sometimes the "name" field if present. You can't use a custom field like "tooltip_text" as the metric or polygon because those require specific data types (geometry for polygons, numeric for metrics) [example](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx). If you want to display a custom-formatted value in the tooltip (like a concatenated string), you have two options: 1. **If your Superset version includes the "Customize tooltips template" feature** (recently added), you can use a Handlebars template to reference any column or metric in your dataset. In the chart's control panel, look for a "Customize tooltips template" field and use something like: ``` {{ tooltip_text }} ``` or combine fields as needed. If you leave the template empty, Superset falls back to the default tooltip [details](https://github.com/apache/superset/pull/34276). 2. **If you don't have the template feature**, you can only show fields that are selected as the metric, polygon column, or possibly as a "dimension" (if available in the UI). There is no way to add an arbitrary field to the tooltip unless you use the JavaScript controls (which require relaxing CSP, not recommended for production). In this case, you can pre-format your tooltip content in your dataset (e.g., as a string column), but it will only appear in the tooltip if you can select it as a dimension or if it's included by default. In summary: you can't use "tooltip_text" as a metric or polygon, and there is no explicit tooltip field. If you have the tooltip template feature, use it to customize your tooltip. Otherwise, you're limited to the default fields shown in the tooltip. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fc7d3f20-93af-40b8-b77d-940c3750b299?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=You%27re%20right%E2%80%94there%20isn%27t%20a%20dedicated%20tooltip%20field%20in%20the%20deck.gl%20Polygon%20chart%20configuration.%20By%20default%2C%20tooltips%20show%20the%20polygon%20geometry%20%28from%20the%20%22Polygon%22%20column%29%2C%20the%20metric%2C%20and%20sometimes%20the%20%22name%22%20field%20if%20present.%20You%20can%27t%20use%20a%20custom%20field%20like%20%22tooltip_text%22%20as%20the%20metric%20or%20polygon%20because%20those%20require%20specific%20data%20types%20%28geometry%20for%20polygons%2C%20numeric%20for%20metrics%29%C2%A0%5Bexample%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx%29.%0A%0AIf%20you%20 want%20to%20display%20a%20custom-formatted%20value%20in%20the%20tooltip%20%28like%20a%20concatenated%20string%29%2C%20you%20have%20two%20options%3A%0A%0A1.%20%2A%2AIf%20your%20Superset%20version%20includes%20the%20%22Customize%20tooltips%20template%22%20feature%2A%2A%20%28recently%20added%29%2C%20you%20can%20use%20a%20Handlebars%20template%20to%20reference%20any%20column%20or%20metric%20in%20your%20dataset.%20In%20the%20chart%27s%20control%20panel%2C%20look%20for%20a%20%22Customize%20tooltips%20template%22%20field%20and%20use%20something%20like%3A%0A%20%20%20%60%60%60%0A%20%20%20%7B%7B%20tooltip_text%20%7D%7D%0A%20%20%20%60%60%60%0A%20%20%20or%20combine%20fields%20as%20needed.%20If%20you%20leave%20the%20template%20empty%2C%20Superset%20falls%20back%20to%20the%20default%20tooltip%C2%A0%5Bdetails%5D%28https%3A//github.com/apache/superset/pull/34276%29.%0A%0A2.%20%2A%2AIf%20you%20don%27t%20have%20the%20template%20feature%2A%2A%2C%20you%20can%20only%20show%20fields%20that%20are%20select ed%20as%20the%20metric%2C%20polygon%20column%2C%20or%20possibly%20as%20a%20%22dimension%22%20%28if%20available%20in%20the%20UI%29.%20There%20is%20no%20way%20to%20add%20an%20arbitrary%20field%20to%20the%20tooltip%20unless%20you%20use%20the%20JavaScript%20controls%20%28which%20require%20relaxing%20CSP%2C%20not%20recommended%20for%20production%29.%20In%20this%20case%2C%20you%20can%20pre-format%20your%20tooltip%20content%20in%20your%20dataset%20%28e.g.%2C%20as%20a%20string%20column%29%2C%20but%20it%20will%20only%20appear%20in%20the%20tooltip%20if%20you%20can%20select%20it%20as%20a%20dimension%20or%20if%20it%27s%20included%20by%20default.%0A%0AIn%20summary%3A%20you%20can%27t%20use%20%22tooltip_text%22%20as%20a%20metric%20or%20polygon%2C%20and%20there%20is%20no%20explicit%20tooltip%20field.%20If%20you%20have%20the%20tooltip%20template%20feature%2C%20use%20it%20to%20customize%20your%20tooltip.%20Otherwise%2C%20you%27re%20limited%20to%20the%20default%20fields%20shown%20in%20the%20tooltip.)& nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36779) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
