dosubot[bot] commented on issue #36779: URL: https://github.com/apache/superset/issues/36779#issuecomment-3678701423
<!-- Answer --> To show a field in the tooltip for a deck.gl Polygon chart, you need to include that field in your dataset and then select it in the chart's configuration panel under the "Query" section. The fields that appear in the tooltip are typically those you choose for "Polygon Column" (the geometry), "metric" (the value), and any other columns you select as dimensions or groupings. There isn't a dedicated "tooltip field" selector—Superset builds the tooltip from the fields you select for the chart's main configuration, like the metric and polygon column. If you want a custom-formatted value, create a new field in your dataset (with any name), and select it as one of these fields in the chart configuration. If you want to use custom JavaScript for tooltips, you can use the "jsTooltip" option in the "Advanced" section, but this requires enabling JavaScript controls and relaxing your Content Security Policy, which is not recommended for production environments [see source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts#L50-L218). So, in short: add your field to the dataset, and select it as a metric, dimension, or polygon column in the chart's "Query" section. Superset will then include it 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/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a052d4de-b81a-4712-8df5-75e68230fd2f?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=To%20show%20a%20field%20in%20the%20tooltip%20for%20a%20deck.gl%20Polygon%20chart%2C%20you%20need%20to%20include%20that%20field%20in%20your%20dataset%20and%20then%20select%20it%20in%20the%20chart%27s%20configuration%20panel%20under%20the%20%22Query%22%20section.%20The%20fields%20that%20appear%20in%20the%20tooltip%20are%20typically%20those%20you%20choose%20for%20%22Polygon%20Column%22%20%28the%20geometry%29%2C%20%22metric%22%20%28the%20value%29%2C%20and%20any%20other%20columns%20you%20select%20as%20dimensions%20or%20groupings.%20There%20isn%27t%20a%20dedicated%20%22tooltip%20field%22%20selector%E2%80%94Superset%20builds%20the%20tooltip%20from%20the%20fields%20you%20select%20for%20the%20chart%27s%20main%20configuration%2C%20like%20the%20metric%20and%2 0polygon%20column.%20If%20you%20want%20a%20custom-formatted%20value%2C%20create%20a%20new%20field%20in%20your%20dataset%20%28with%20any%20name%29%2C%20and%20select%20it%20as%20one%20of%20these%20fields%20in%20the%20chart%20configuration.%20%0A%0AIf%20you%20want%20to%20use%20custom%20JavaScript%20for%20tooltips%2C%20you%20can%20use%20the%20%22jsTooltip%22%20option%20in%20the%20%22Advanced%22%20section%2C%20but%20this%20requires%20enabling%20JavaScript%20controls%20and%20relaxing%20your%20Content%20Security%20Policy%2C%20which%20is%20not%20recommended%20for%20production%20environments%C2%A0%5Bsee%20source%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts%23L50-L218%29.%0A%0ASo%2C%20in%20short%3A%20add%20your%20field%20to%20the%20dataset%2C%20and%20select%20it%20as%20a%20metric%2C%20dimension%2C%20or%20polygon%20column%20in%20the%20chart%27s%20%22Query%22%20sect ion.%20Superset%20will%20then%20include%20it%20in%20the%20tooltip.) [](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]
