@@ -1356,16 +1356,23 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
13561356 * log axes (where negative values can't be displayed but can appear in hover text)
13571357 *
13581358 * @param {object } ax: the axis to format text for
1359- * @param {number } val : calcdata value to format
1360- * @param {Optional(number ) } val2: a second value to display
1359+ * @param {number } values : calcdata value(s) to format
1360+ * @param {Optional(string ) } hoverformat: trace (x|y)hoverformat to override axis.hoverformat
13611361 *
13621362 * @returns {string } `val` formatted as a string appropriate to this axis, or
1363- * `val` and `val2` as a range (ie '<val > - <val2>') if `val2` is provided and
1364- * it's different from `val` .
1363+ * first value and second value as a range (ie '<val1 > - <val2>') if the second value is provided and
1364+ * it's different from the first value .
13651365 */
1366- axes . hoverLabelText = function ( ax , val , val2 ) {
1367- if ( val2 !== BADNUM && val2 !== val ) {
1368- return axes . hoverLabelText ( ax , val ) + ' - ' + axes . hoverLabelText ( ax , val2 ) ;
1366+ axes . hoverLabelText = function ( ax , values , hoverformat ) {
1367+ if ( hoverformat ) ax = Lib . extendFlat ( { } , ax , { hoverformat : hoverformat } ) ;
1368+
1369+ var val = Array . isArray ( values ) ? values [ 0 ] : values ;
1370+ var val2 = Array . isArray ( values ) ? values [ 1 ] : undefined ;
1371+ if ( val2 !== undefined && val2 !== val ) {
1372+ return (
1373+ axes . hoverLabelText ( ax , val , hoverformat ) + ' - ' +
1374+ axes . hoverLabelText ( ax , val2 , hoverformat )
1375+ ) ;
13691376 }
13701377
13711378 var logOffScale = ( ax . type === 'log' && val <= 0 ) ;
0 commit comments