@@ -8,6 +8,7 @@ import {UnconnectedAxisRangeValue} from './AxisRangeValue';
88import { UnconnectedRadio } from './Radio' ;
99import Info from './Info' ;
1010import { UnconnectedColorPicker } from './ColorPicker' ;
11+ import { UnconnectedTextEditor } from './TextEditor' ;
1112import { UnconnectedVisibilitySelect } from './VisibilitySelect' ;
1213import { connectToContainer , getAllAxes , getAxisTitle , axisIdToAxisName } from 'lib' ;
1314
@@ -523,9 +524,19 @@ export const HoverTemplateSwitch = connectToContainer(UnconnectedRadio, {
523524 const { localize : _ } = context ;
524525
525526 plotProps . options = [
526- { label : _ ( 'Basic ' ) , value : '' } ,
527- { label : _ ( 'Advanced ' ) , value : plotProps . fullValue || 'template ' } ,
527+ { label : _ ( 'Values ' ) , value : '' } ,
528+ { label : _ ( 'Template ' ) , value : plotProps . fullValue || ' ' } ,
528529 ] ;
530+ return plotProps ;
531+ } ,
532+ } ) ;
533+
534+ export const HoverTemplateText = connectToContainer ( UnconnectedTextEditor , {
535+ modifyPlotProps : ( props , context , plotProps ) => {
536+ if ( plotProps . isVisible && plotProps . fullValue === '' ) {
537+ plotProps . isVisible = false ;
538+ }
539+ return plotProps ;
529540 } ,
530541} ) ;
531542
0 commit comments