From 3adf2f689e0cb7db9dcf04d0545c2fc4cf43d57e Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Mon, 9 Jun 2025 11:23:44 -0400 Subject: [PATCH 1/6] add unifiedhovertemplate --- src/components/fx/hover.js | 18 +++++++++++++++++- src/plots/cartesian/axis_defaults.js | 5 ++++- src/plots/cartesian/layout_attributes.js | 4 ++++ src/plots/gl3d/layout/axis_defaults.js | 1 + src/plots/template_attributes.js | 4 +++- test/plot-schema.json | 24 ++++++++++++++++++++++++ 6 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 80fc4a07cf3..2153d70dbb7 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -1211,10 +1211,26 @@ function createHoverText(hoverData, opts) { // mock legend var hoverlabel = fullLayout.hoverlabel; var font = hoverlabel.font; + + var item0 = groupedHoverData[0]; + + var unifiedhovertemplate = ( + hovermode === 'y unified' ? + item0.xa : + item0.ya + ).unifiedhovertemplate; + + var mainText = !unifiedhovertemplate ? t0 : + Lib.hovertemplateString(unifiedhovertemplate, {}, fullLayout._d3locale, + hovermode === 'y unified' ? + {xa: item0.xa, x: item0.xVal} : + {ya: item0.ya, y: item0.yVal} + ); + var mockLayoutIn = { showlegend: true, legend: { - title: {text: t0, font: font}, + title: {text: mainText, font: font}, font: font, bgcolor: hoverlabel.bgcolor, bordercolor: hoverlabel.bordercolor, diff --git a/src/plots/cartesian/axis_defaults.js b/src/plots/cartesian/axis_defaults.js index 4531785cd2f..a1c091863e1 100644 --- a/src/plots/cartesian/axis_defaults.js +++ b/src/plots/cartesian/axis_defaults.js @@ -100,7 +100,10 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce, handleCategoryOrderDefaults(containerIn, containerOut, coerce, options); - if(axType !== 'category' && !options.noHover) coerce('hoverformat'); + if(!options.noHover) { + if(axType !== 'category') coerce('hoverformat'); + if(!options.noUnifiedhovertemplate) coerce('unifiedhovertemplate'); + } var dfltColor = coerce('color'); // if axis.color was provided, use it for fonts too; otherwise, diff --git a/src/plots/cartesian/layout_attributes.js b/src/plots/cartesian/layout_attributes.js index f1b7bbbe5d6..7b255e75006 100644 --- a/src/plots/cartesian/layout_attributes.js +++ b/src/plots/cartesian/layout_attributes.js @@ -5,6 +5,7 @@ var colorAttrs = require('../../components/color/attributes'); var dash = require('../../components/drawing/attributes').dash; var extendFlat = require('../../lib/extend').extendFlat; var templatedArray = require('../../plot_api/plot_template').templatedArray; +var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs; var descriptionWithDates = require('../../plots/cartesian/axis_format_attributes').descriptionWithDates; var ONEDAY = require('../../constants/numerical').ONEDAY; @@ -975,6 +976,9 @@ module.exports = { editType: 'none', description: descriptionWithDates('hover text') }, + unifiedhovertemplate: hovertemplateAttrs({ + noSupportOther: true + }), // lines and grids showline: { valType: 'boolean', diff --git a/src/plots/gl3d/layout/axis_defaults.js b/src/plots/gl3d/layout/axis_defaults.js index e3d71be24cb..d8df3f46032 100644 --- a/src/plots/gl3d/layout/axis_defaults.js +++ b/src/plots/gl3d/layout/axis_defaults.js @@ -51,6 +51,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { noTicklabelposition: true, noTicklabeloverflow: true, noInsiderange: true, + noUnifiedhovertemplate: true, bgColor: options.bgColor, calendar: options.calendar }, diff --git a/src/plots/template_attributes.js b/src/plots/template_attributes.js index 9f01f920688..80e3d77d886 100644 --- a/src/plots/template_attributes.js +++ b/src/plots/template_attributes.js @@ -71,7 +71,9 @@ exports.hovertemplateAttrs = function(opts, extra) { description: [ 'Template string used for rendering the information that appear on hover box.', 'Note that this will override `hoverinfo`.', - templateFormatStringDescription({supportOther: true}), + templateFormatStringDescription({ + supportOther: opts.noSupportOther ? false : true + }), 'The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.', 'Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.', descPart, diff --git a/test/plot-schema.json b/test/plot-schema.json index df08db9d5c3..7904e8038a8 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -14949,6 +14949,18 @@ "editType": "none", "valType": "any" }, + "unifiedhovertemplate": { + "arrayOk": true, + "description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example \"{fullData.name}\". To hide the secondary box completely, use an empty tag ``.", + "dflt": "", + "editType": "none", + "valType": "string" + }, + "unifiedhovertemplatesrc": { + "description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.", + "editType": "none", + "valType": "string" + }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", @@ -16193,6 +16205,18 @@ "editType": "none", "valType": "any" }, + "unifiedhovertemplate": { + "arrayOk": true, + "description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example \"{fullData.name}\". To hide the secondary box completely, use an empty tag ``.", + "dflt": "", + "editType": "none", + "valType": "string" + }, + "unifiedhovertemplatesrc": { + "description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.", + "editType": "none", + "valType": "string" + }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", From 9dcc03fe07974cc9e4b7e5deeb10ad14a76efbb1 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Tue, 10 Jun 2025 11:43:49 -0400 Subject: [PATCH 2/6] revise attribute description --- src/plots/cartesian/layout_attributes.js | 14 ++++++++++---- src/plots/template_attributes.js | 5 ++--- test/plot-schema.json | 16 ++-------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/plots/cartesian/layout_attributes.js b/src/plots/cartesian/layout_attributes.js index 7b255e75006..fc0e70e2345 100644 --- a/src/plots/cartesian/layout_attributes.js +++ b/src/plots/cartesian/layout_attributes.js @@ -5,7 +5,7 @@ var colorAttrs = require('../../components/color/attributes'); var dash = require('../../components/drawing/attributes').dash; var extendFlat = require('../../lib/extend').extendFlat; var templatedArray = require('../../plot_api/plot_template').templatedArray; -var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs; +var templateFormatStringDescription = require('../../plots/template_attributes').templateFormatStringDescription; var descriptionWithDates = require('../../plots/cartesian/axis_format_attributes').descriptionWithDates; var ONEDAY = require('../../constants/numerical').ONEDAY; @@ -976,9 +976,15 @@ module.exports = { editType: 'none', description: descriptionWithDates('hover text') }, - unifiedhovertemplate: hovertemplateAttrs({ - noSupportOther: true - }), + unifiedhovertemplate: { + valType: 'string', + dflt: '', + editType: 'none', + description: [ + 'Template string used for rendering the title that appear on x or y unified hover box.', + templateFormatStringDescription() + ].join(' ') + }, // lines and grids showline: { valType: 'boolean', diff --git a/src/plots/template_attributes.js b/src/plots/template_attributes.js index 80e3d77d886..5d5193c3f30 100644 --- a/src/plots/template_attributes.js +++ b/src/plots/template_attributes.js @@ -22,6 +22,7 @@ function templateFormatStringDescription(opts) { 'for details on the date formatting syntax.' ].join(' '); } +exports.templateFormatStringDescription = templateFormatStringDescription; function shapeTemplateFormatStringDescription() { return [ @@ -71,9 +72,7 @@ exports.hovertemplateAttrs = function(opts, extra) { description: [ 'Template string used for rendering the information that appear on hover box.', 'Note that this will override `hoverinfo`.', - templateFormatStringDescription({ - supportOther: opts.noSupportOther ? false : true - }), + templateFormatStringDescription({supportOther: true}), 'The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.', 'Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.', descPart, diff --git a/test/plot-schema.json b/test/plot-schema.json index 7904e8038a8..249bcc278ba 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -14950,17 +14950,11 @@ "valType": "any" }, "unifiedhovertemplate": { - "arrayOk": true, - "description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example \"{fullData.name}\". To hide the secondary box completely, use an empty tag ``.", + "description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.", "dflt": "", "editType": "none", "valType": "string" }, - "unifiedhovertemplatesrc": { - "description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.", - "editType": "none", - "valType": "string" - }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", @@ -16206,17 +16200,11 @@ "valType": "any" }, "unifiedhovertemplate": { - "arrayOk": true, - "description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example \"{fullData.name}\". To hide the secondary box completely, use an empty tag ``.", + "description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.", "dflt": "", "editType": "none", "valType": "string" }, - "unifiedhovertemplatesrc": { - "description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.", - "editType": "none", - "valType": "string" - }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", From 81fcf2ce007b801778e9483a3488a29cd05fc53c Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Fri, 4 Jul 2025 17:08:04 -0400 Subject: [PATCH 3/6] fix axis --- src/components/fx/hover.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 2153d70dbb7..4a7677a2c43 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -1215,14 +1215,14 @@ function createHoverText(hoverData, opts) { var item0 = groupedHoverData[0]; var unifiedhovertemplate = ( - hovermode === 'y unified' ? + hovermode === 'x unified' ? item0.xa : item0.ya ).unifiedhovertemplate; var mainText = !unifiedhovertemplate ? t0 : Lib.hovertemplateString(unifiedhovertemplate, {}, fullLayout._d3locale, - hovermode === 'y unified' ? + hovermode === 'x unified' ? {xa: item0.xa, x: item0.xVal} : {ya: item0.ya, y: item0.yVal} ); From 9f8e9fdd690033623dda19301bdf46202e62e961 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Fri, 4 Jul 2025 20:28:37 -0400 Subject: [PATCH 4/6] add jasmine tests --- test/jasmine/tests/hover_label_test.js | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/test/jasmine/tests/hover_label_test.js b/test/jasmine/tests/hover_label_test.js index a9af59100c0..8eea4827f54 100644 --- a/test/jasmine/tests/hover_label_test.js +++ b/test/jasmine/tests/hover_label_test.js @@ -6901,6 +6901,73 @@ describe('hovermode: (x|y)unified', function() { }) .then(done, done.fail); }); + + it('should format title of unified hover in respect to `unifiedhovertemplate` linear axis', function(done) { + Plotly.newPlot(gd, [{ + type: 'bar', + y: [1, 2, 3] + }, { + type: 'scatter', + y: [2, 3, 1] + }], { + xaxis: { + unifiedhovertemplate: 'X: %{x:.2f}', + }, + hovermode: 'x unified', + showlegend: false, + width: 500, + height: 500, + margin: { + t: 50, + b: 50, + l: 50, + r: 50 + } + }) + .then(function() { + _hover(gd, { xpx: 200, ypx: 200 }); + assertLabel({title: 'X: 1.00', items: [ + 'trace 0 : 2', + 'trace 1 : 3' + ]}); + }) + .then(done, done.fail); + }); + + it('should format title of unified hover in respect to `unifiedhovertemplate` date axis', function(done) { + Plotly.newPlot(gd, [{ + type: 'bar', + x: ['2000-01-01', '2000-02-01', '2000-03-01'], + y: [1, 2, 3] + }, { + type: 'scatter', + x: ['2000-01-01', '2000-02-01', '2000-03-01'], + y: [2, 3, 1] + }], { + xaxis: { + type: 'date', + unifiedhovertemplate: 'X: %{x|%x %X}', + }, + hovermode: 'x unified', + showlegend: false, + width: 500, + height: 500, + margin: { + t: 50, + b: 50, + l: 50, + r: 50 + } + }) + .then(function() { + _hover(gd, { xpx: 200, ypx: 200 }); + assertLabel({title: 'X: 02/01/2000 00:00:00', items: [ + 'trace 0 : 2', + 'trace 1 : 3' + ]}); + }) + .then(done, done.fail); + }); }); describe('hover on traces with (x|y)hoverformat', function() { From 9e44a73383ef8a1b4e68ffb582c03a9e06a06813 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Mon, 7 Jul 2025 12:01:56 -0400 Subject: [PATCH 5/6] draft log --- draftlogs/7439_add.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/7439_add.md diff --git a/draftlogs/7439_add.md b/draftlogs/7439_add.md new file mode 100644 index 00000000000..d413c949f3f --- /dev/null +++ b/draftlogs/7439_add.md @@ -0,0 +1 @@ + - Add unifiedhovertemplate to format unified hover title [[#7439](https://github.com/plotly/plotly.js/pull/7439)] From 4890881f639ac630f3b71da34f6d2c8efbc00316 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Tue, 15 Jul 2025 11:03:24 -0400 Subject: [PATCH 6/6] unifiedhovertemplate > unifiedhovertitle --- draftlogs/7439_add.md | 2 +- src/components/fx/hover.js | 8 ++++---- src/plots/cartesian/axis_defaults.js | 2 +- src/plots/cartesian/layout_attributes.js | 2 +- src/plots/gl3d/layout/axis_defaults.js | 2 +- test/jasmine/tests/hover_label_test.js | 8 ++++---- test/plot-schema.json | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/draftlogs/7439_add.md b/draftlogs/7439_add.md index d413c949f3f..6c1bee8ea9e 100644 --- a/draftlogs/7439_add.md +++ b/draftlogs/7439_add.md @@ -1 +1 @@ - - Add unifiedhovertemplate to format unified hover title [[#7439](https://github.com/plotly/plotly.js/pull/7439)] + - Add unifiedhovertitle to format unified hover title [[#7439](https://github.com/plotly/plotly.js/pull/7439)] diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 4a7677a2c43..84bfd171d94 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -1214,14 +1214,14 @@ function createHoverText(hoverData, opts) { var item0 = groupedHoverData[0]; - var unifiedhovertemplate = ( + var unifiedhovertitle = ( hovermode === 'x unified' ? item0.xa : item0.ya - ).unifiedhovertemplate; + ).unifiedhovertitle; - var mainText = !unifiedhovertemplate ? t0 : - Lib.hovertemplateString(unifiedhovertemplate, {}, fullLayout._d3locale, + var mainText = !unifiedhovertitle ? t0 : + Lib.hovertemplateString(unifiedhovertitle, {}, fullLayout._d3locale, hovermode === 'x unified' ? {xa: item0.xa, x: item0.xVal} : {ya: item0.ya, y: item0.yVal} diff --git a/src/plots/cartesian/axis_defaults.js b/src/plots/cartesian/axis_defaults.js index a1c091863e1..a8199115334 100644 --- a/src/plots/cartesian/axis_defaults.js +++ b/src/plots/cartesian/axis_defaults.js @@ -102,7 +102,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce, if(!options.noHover) { if(axType !== 'category') coerce('hoverformat'); - if(!options.noUnifiedhovertemplate) coerce('unifiedhovertemplate'); + if(!options.noUnifiedhovertitle) coerce('unifiedhovertitle'); } var dfltColor = coerce('color'); diff --git a/src/plots/cartesian/layout_attributes.js b/src/plots/cartesian/layout_attributes.js index fc0e70e2345..e4ca70c52fc 100644 --- a/src/plots/cartesian/layout_attributes.js +++ b/src/plots/cartesian/layout_attributes.js @@ -976,7 +976,7 @@ module.exports = { editType: 'none', description: descriptionWithDates('hover text') }, - unifiedhovertemplate: { + unifiedhovertitle: { valType: 'string', dflt: '', editType: 'none', diff --git a/src/plots/gl3d/layout/axis_defaults.js b/src/plots/gl3d/layout/axis_defaults.js index d8df3f46032..3631242dc22 100644 --- a/src/plots/gl3d/layout/axis_defaults.js +++ b/src/plots/gl3d/layout/axis_defaults.js @@ -51,7 +51,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { noTicklabelposition: true, noTicklabeloverflow: true, noInsiderange: true, - noUnifiedhovertemplate: true, + noUnifiedhovertitle: true, bgColor: options.bgColor, calendar: options.calendar }, diff --git a/test/jasmine/tests/hover_label_test.js b/test/jasmine/tests/hover_label_test.js index 8eea4827f54..6c23cc90424 100644 --- a/test/jasmine/tests/hover_label_test.js +++ b/test/jasmine/tests/hover_label_test.js @@ -6902,7 +6902,7 @@ describe('hovermode: (x|y)unified', function() { .then(done, done.fail); }); - it('should format title of unified hover in respect to `unifiedhovertemplate` linear axis', function(done) { + it('should format title of unified hover in respect to `unifiedhovertitle` linear axis', function(done) { Plotly.newPlot(gd, [{ type: 'bar', y: [1, 2, 3] @@ -6911,7 +6911,7 @@ describe('hovermode: (x|y)unified', function() { y: [2, 3, 1] }], { xaxis: { - unifiedhovertemplate: 'X: %{x:.2f}', + unifiedhovertitle: 'X: %{x:.2f}', }, hovermode: 'x unified', showlegend: false, @@ -6934,7 +6934,7 @@ describe('hovermode: (x|y)unified', function() { .then(done, done.fail); }); - it('should format title of unified hover in respect to `unifiedhovertemplate` date axis', function(done) { + it('should format title of unified hover in respect to `unifiedhovertitle` date axis', function(done) { Plotly.newPlot(gd, [{ type: 'bar', x: ['2000-01-01', '2000-02-01', '2000-03-01'], @@ -6946,7 +6946,7 @@ describe('hovermode: (x|y)unified', function() { }], { xaxis: { type: 'date', - unifiedhovertemplate: 'X: %{x|%x %X}', + unifiedhovertitle: 'X: %{x|%x %X}', }, hovermode: 'x unified', showlegend: false, diff --git a/test/plot-schema.json b/test/plot-schema.json index 249bcc278ba..348547dab60 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -14949,7 +14949,7 @@ "editType": "none", "valType": "any" }, - "unifiedhovertemplate": { + "unifiedhovertitle": { "description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.", "dflt": "", "editType": "none", @@ -16199,7 +16199,7 @@ "editType": "none", "valType": "any" }, - "unifiedhovertemplate": { + "unifiedhovertitle": { "description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.", "dflt": "", "editType": "none",