You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jeevallucas (via GitHub)" <gi...@apache.org> on 2025/09/29 02:37:23 UTC

[D] Feature Request: Custom Hover Text / Tooltip Annotation for Charts [superset]

GitHub user jeevallucas created a discussion: Feature Request: Custom Hover Text / Tooltip Annotation for Charts

### 🧩 Problem Statement / Motivation

In many visualization tools, one expects the ability to show custom, user-defined text when hovering over data points (e.g. you hover over a bar, line point, area, or cell, and see a custom message). Currently, Superset’s tooltips or hover info are limited to showing predefined metrics, dimensions, or default metadata. There is no straightforward way to inject arbitrary text or annotation on hover (e.g. explanatory notes, comments, or context-specific messages).

This limitation reduces flexibility when users want to provide additional context, notes, or dynamic messages directly on visualizations without altering the underlying data.

### Proposed Solution / Feature Description

Introduce a configuration option (per chart, or per visualization plugin) that allows the dashboard/visualization author to define a custom hover text template or field. Key aspects:

* A new property (for example: `hover_annotation_template`) in the chart’s configuration panel.
* The template can support placeholders or variables (e.g. `{{ metric_name }}`, `{{ dimension }}`, `{{ custom_field }}`) so authors can build contextual hover messages.
* At rendering time, when a user hovers over a chart element, Superset evaluates the template and displays the resulting text as a tooltip or overlay.
* For charts that support rich rendering (e.g. HTML tooltips, multiline), allow simple formatting (line breaks, bold, etc.).
* Optionally, allow conditional logic (e.g. only show hover annotation if a metric exceeds a threshold) — although this is an enhancement to the base feature.

This feature would be integrated into chart plugins (in `superset-frontend`) and propagate through the metadata and tooltip rendering layer.

### šŸ“ Scope & Non-Goals

**In scope**:

* Simple custom hover text injection with templating.
* Support for existing chart types (bar, line, scatter, area, table, etc.).
* UI to configure the template in chart editor.
* Safe escaping / sanitization to prevent XSS or broken rendering.

**Out of scope** (for a first version):

* Full scripting or complex logic in hover templates (e.g. full JavaScript).
* Cross-chart hover linking (hover in chart A triggers annotation in chart B).
* Very custom tooltip layouts beyond simple text / minor formatting.
* Automatic fallback for charts that don’t support tooltips (those remain unaffected).

### šŸŽÆ Benefits / Use Cases

* Analysts can embed explanatory notes or insights directly into charts, helping dashboard consumers understand nuances without external documentation.
* Data storytelling: highlight anomalies, warnings, or tips in hover text.
* Interactive dashboards where hovering can reveal extra context or user instructions.
* Support for multilingual or dynamic commentary without altering the underlying dataset.


GitHub link: https://github.com/apache/superset/discussions/35319

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [D] Feature Request: Custom Hover Text / Tooltip Annotation for Charts [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
GitHub user msyavuz added a comment to the discussion: Feature Request: Custom Hover Text / Tooltip Annotation for Charts

I thought we had something like this, i am not against it as long as there is a big sign saying `This is not secure, use it on your own discretion` on the feature.

GitHub link: https://github.com/apache/superset/discussions/35319#discussioncomment-14577447

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org