@@ -1065,36 +1065,14 @@ function cleanPoint(d, hovermode) {
1065
1065
1066
1066
// and convert the x and y label values into objects
1067
1067
// formatted as text, with font info
1068
- var logOffScale ;
1069
1068
if ( d . xLabelVal !== undefined ) {
1070
- logOffScale = ( d . xa . type === 'log' && d . xLabelVal <= 0 ) ;
1071
- var xLabelObj = Axes . tickText ( d . xa ,
1072
- d . xa . c2l ( logOffScale ? - d . xLabelVal : d . xLabelVal ) , 'hover' ) ;
1073
- if ( logOffScale ) {
1074
- if ( d . xLabelVal === 0 ) d . xLabel = '0' ;
1075
- else d . xLabel = '-' + xLabelObj . text ;
1076
- }
1077
- // TODO: should we do something special if the axis calendar and
1078
- // the data calendar are different? Somehow display both dates with
1079
- // their system names? Right now it will just display in the axis calendar
1080
- // but users could add the other one as text.
1081
- else d . xLabel = xLabelObj . text ;
1069
+ d . xLabel = ( 'xLabel' in d ) ? d . xLabel : Axes . hoverLabelText ( d . xa , d . xLabelVal ) ;
1082
1070
d . xVal = d . xa . c2d ( d . xLabelVal ) ;
1083
1071
}
1084
-
1085
1072
if ( d . yLabelVal !== undefined ) {
1086
- logOffScale = ( d . ya . type === 'log' && d . yLabelVal <= 0 ) ;
1087
- var yLabelObj = Axes . tickText ( d . ya ,
1088
- d . ya . c2l ( logOffScale ? - d . yLabelVal : d . yLabelVal ) , 'hover' ) ;
1089
- if ( logOffScale ) {
1090
- if ( d . yLabelVal === 0 ) d . yLabel = '0' ;
1091
- else d . yLabel = '-' + yLabelObj . text ;
1092
- }
1093
- // TODO: see above TODO
1094
- else d . yLabel = yLabelObj . text ;
1073
+ d . yLabel = ( 'yLabel' in d ) ? d . yLabel : Axes . hoverLabelText ( d . ya , d . yLabelVal ) ;
1095
1074
d . yVal = d . ya . c2d ( d . yLabelVal ) ;
1096
1075
}
1097
-
1098
1076
if ( d . zLabelVal !== undefined ) d . zLabel = String ( d . zLabelVal ) ;
1099
1077
1100
1078
// for box means and error bars, add the range to the label
0 commit comments