dosubot[bot] commented on issue #36779:
URL: https://github.com/apache/superset/issues/36779#issuecomment-3881919594

   <!-- Answer -->
   To show province name (`tenTinh` as `name`) and code (`maTinh`) in the 
deck.gl Polygon tooltip, you need to include them inside the `properties` block 
of your GeoJSON feature. Superset tooltips only display fields present in the 
GeoJSON properties, not separate SQL columns [see 
source](https://github.com/apache/superset/issues/34748).
   
   Update your SQL view so the `geojson` column outputs something like:
   
   ```sql
   JSON_QUERY(
       CONCAT(
           '{"type":"Feature","geometry":', b.geojson,
           ',"properties":{"maTinh":"', d.maTinh,
           '","name":"', d.tenTinh,
           '","SoDiemKetNoi":', COUNT(f.maFact),
           '}}'
       )
   ) AS geojson
   ```
   
   This ensures `maTinh`, `name`, and `SoDiemKetNoi` are available in the 
tooltip [see example](https://github.com/apache/superset/issues/33618). After 
updating your view, refresh your dataset in Superset and configure the chart to 
use the new `geojson` column as the polygon geometry and `SoDiemKetNoi` as the 
metric.
   
   Limitations: tooltips only show plain text fields from properties; HTML is 
not rendered for security reasons [see 
details](https://github.com/apache/superset/pull/33791). Persistent labels on 
polygons are not supported—only tooltips on hover [see 
discussion](https://github.com/apache/superset/discussions/36554).
   
   
   <!-- 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/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/f0eda733-b2bd-4f11-8b45-1890dcd2755f?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=To%20show%20province%20name%20%28%60tenTinh%60%20as%20%60name%60%29%20and%20code%20%28%60maTinh%60%29%20in%20the%20deck.gl%20Polygon%20tooltip%2C%20you%20need%20to%20include%20them%20inside%20the%20%60properties%60%20block%20of%20your%20GeoJSON%20feature.%20Superset%20tooltips%20only%20display%20fields%20present%20in%20the%20GeoJSON%20properties%2C%20not%20separate%20SQL%20columns%C2%A0%5Bsee%20source%5D%28https%3A//github.com/apache/superset/issues/34748%29.%0A%0AUpdate%20your%20SQL%20view%20so%20the%20%60geojson%60%20column%20outputs%20something%20like%3A%0A%0A%60%60%60sql%0AJSON_QUERY%28%0A%20%20%20%20CONCAT%28%0A%20%20%20%20%20%20%20%20%27%7B%22type%22%3A%22Feature%22%2C%22geometry%22%3A%27%2C%20b.geojson%2C%0A%20%20%20%20%20%20%20%20%27%2C%22p
 
roperties%22%3A%7B%22maTinh%22%3A%22%27%2C%20d.maTinh%2C%0A%20%20%20%20%20%20%20%20%27%22%2C%22name%22%3A%22%27%2C%20d.tenTinh%2C%0A%20%20%20%20%20%20%20%20%27%22%2C%22SoDiemKetNoi%22%3A%27%2C%20COUNT%28f.maFact%29%2C%0A%20%20%20%20%20%20%20%20%27%7D%7D%27%0A%20%20%20%20%29%0A%29%20AS%20geojson%0A%60%60%60%0A%0AThis%20ensures%20%60maTinh%60%2C%20%60name%60%2C%20and%20%60SoDiemKetNoi%60%20are%20available%20in%20the%20tooltip%C2%A0%5Bsee%20example%5D%28https%3A//github.com/apache/superset/issues/33618%29.%20After%20updating%20your%20view%2C%20refresh%20your%20dataset%20in%20Superset%20and%20configure%20the%20chart%20to%20use%20the%20new%20%60geojson%60%20column%20as%20the%20polygon%20geometry%20and%20%60SoDiemKetNoi%60%20as%20the%20metric.%0A%0ALimitations%3A%20tooltips%20only%20show%20plain%20text%20fields%20from%20properties%3B%20HTML%20is%20not%20rendered%20for%20security%20reasons%C2%A0%5Bsee%20details%5D%28https%3A//github.com/apache/superset/pull/33791%29.%20Persistent%20labels%
 
20on%20polygons%20are%20not%20supported%E2%80%94only%20tooltips%20on%20hover%C2%A0%5Bsee%20discussion%5D%28https%3A//github.com/apache/superset/discussions/36554%29.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](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]

Reply via email to