function textEditHandler(e) {
  let annotation;
  if (e.annotation.getType() === 'label') {
    $annotationLabel
      .val(e.annotation.text())
      .focus()
      .on('change keyup paste', function(e) {
        if (e.keyCode === 46) return;
        annotation = chart.annotations().getSelectedAnnotation();
        if (annotation) {
          $(this).val() ?
            annotation.text($(this).val()) :
            annotation.text(' ') && $(this).val(' ');
          updateAnnotationsState();
        }
      });
  }
}
/**
 * handler for the labels text edit
 * @param {Object} e event object
 */
handler for the labels text edit
@param {Object} e event object
handler for the labels text edit @param { Object } e event object
function textEditHandler(e) {
  let annotation;
  if (e.annotation.getType() === 'label') {
    $annotationLabel
      .val(e.annotation.text())
      .focus()
      .on('change keyup paste', function(e) {
        if (e.keyCode === 46) return;
        annotation = chart.annotations().getSelectedAnnotation();
        if (annotation) {
          $(this).val() ?
            annotation.text($(this).val()) :
            annotation.text(' ') && $(this).val(' ');
          updateAnnotationsState();
        }
      });
  }
}
function textEditHandler ( e ) { let annotation ; if ( e . annotation . getType ( ) === 'label' ) { $annotationLabel . val ( e . annotation . text ( ) ) . focus ( ) . on ( 'change keyup paste' , function ( e ) { if ( e . keyCode === 46 ) return ; annotation = chart . annotations ( ) . getSelectedAnnotation ( ) ; if ( annotation ) { $ ( this ) . val ( ) ? annotation . text ( $ ( this ) . val ( ) ) : annotation . text ( ' ' ) && $ ( this ) . val ( ' ' ) ; updateAnnotationsState ( ) ; } } ) ; } }
handler for the labels text edit
 @param {Object} e event object
handler for the labels text edit @param { Object } e event object