From ce23f81768327e69e33ac3279ebd3449be9a3ece Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Sat, 28 Mar 2020 21:31:49 +0100 Subject: [PATCH 1/2] Mention extra tag in hovertemplate tutorial Following various interactions on the forum, including https://community.plotly.com/t/tooltip-in-dash-shows-trace-0-how-to-get-rid-of-that/36844/2 --- doc/python/hover-text-and-formatting.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/python/hover-text-and-formatting.md b/doc/python/hover-text-and-formatting.md index ca645b46d79..e53d0477ea1 100644 --- a/doc/python/hover-text-and-formatting.md +++ b/doc/python/hover-text-and-formatting.md @@ -104,8 +104,9 @@ fig.show() ### Customize tooltip text with a hovertemplate To customize the tooltip on your graph you can use [hovertemplate](https://plotly.com/python/reference/#pie-hovertemplate), which is a template string used for rendering the information that appear on hoverbox. -This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format). -Hovertemplate customize the tooltip text vs. [texttemplate](https://plotly.com/python/reference/#pie-texttemplate) which customizes the text that appears on your chart.
+This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format). In the example below, the empty `` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. + +Note that a hovertemplate customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/#pie-texttemplate) customizes the text that appears on your chart.
Set the horizontal alignment of the text within tooltip with [hoverlabel.align](https://plotly.com/python/reference/#layout-hoverlabel-align). ```python From b911d63064fc6019b46fb93ca1b1fc36e4a8c28b Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 9 Apr 2020 14:49:21 +0200 Subject: [PATCH 2/2] more text --- doc/python/hover-text-and-formatting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python/hover-text-and-formatting.md b/doc/python/hover-text-and-formatting.md index e53d0477ea1..d5454f0b995 100644 --- a/doc/python/hover-text-and-formatting.md +++ b/doc/python/hover-text-and-formatting.md @@ -5,7 +5,7 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: "1.2" + format_version: '1.2' jupytext_version: 1.3.0 kernelspec: display_name: Python 3 @@ -104,7 +104,7 @@ fig.show() ### Customize tooltip text with a hovertemplate To customize the tooltip on your graph you can use [hovertemplate](https://plotly.com/python/reference/#pie-hovertemplate), which is a template string used for rendering the information that appear on hoverbox. -This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format). In the example below, the empty `` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. +This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_forma), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format). In the example below, the empty `` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `` tag can be used to display other parts of the hovertemplate, it is not reserved for the trace name. Note that a hovertemplate customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/#pie-texttemplate) customizes the text that appears on your chart.
Set the horizontal alignment of the text within tooltip with [hoverlabel.align](https://plotly.com/python/reference/#layout-hoverlabel-align).