@@ -738,6 +738,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
738
738
var EXTRA_STRING_REGEX = / < e x t r a > ( [ \s \S ] * ) < \/ e x t r a > / ;
739
739
740
740
function createHoverText ( hoverData , opts , gd ) {
741
+ var fullLayout = gd . _fullLayout ;
741
742
var hovermode = opts . hovermode ;
742
743
var rotateLabels = opts . rotateLabels ;
743
744
var bgColor = opts . bgColor ;
@@ -925,6 +926,10 @@ function createHoverText(hoverData, opts, gd) {
925
926
if ( d . nameOverride !== undefined ) d . name = d . nameOverride ;
926
927
927
928
if ( d . name ) {
929
+ if ( fullLayout . meta ) {
930
+ d . name = Lib . templateString ( d . name , { meta : fullLayout . meta } ) ;
931
+ }
932
+
928
933
name = svgTextUtils . plainText ( d . name || '' , {
929
934
len : d . nameLength ,
930
935
allowedTags : [ 'br' , 'sub' , 'sup' , 'b' , 'i' , 'em' ]
@@ -970,7 +975,12 @@ function createHoverText(hoverData, opts, gd) {
970
975
var hovertemplateLabels = d . hovertemplateLabels || d ;
971
976
var eventData = d . eventData [ 0 ] || { } ;
972
977
if ( hovertemplate ) {
973
- text = Lib . hovertemplateString ( hovertemplate , hovertemplateLabels , eventData ) ;
978
+ text = Lib . hovertemplateString (
979
+ hovertemplate ,
980
+ hovertemplateLabels ,
981
+ eventData ,
982
+ { meta : fullLayout . meta }
983
+ ) ;
974
984
975
985
text = text . replace ( EXTRA_STRING_REGEX , function ( match , extra ) {
976
986
name = extra ; // Assign name for secondary text label
0 commit comments