Я использую старшие диаграммы и пытаюсь удалить текущую выбранную аннотацию, вызывая chart.removeAnnotation(chart.currentAnnotation)
, который работает нормально, но вызывает сброс приложения
Uncaught TypeError: Cannot read property 'forEach' of undefined at g.setControlPointsVisibility
. Вот соответствующие части кода:
options
chart:{
events:{
load : function(){
var chart = this;
document.querySelectorAll('.my-toolbar-classname .dbtn')[0]
.addEventListener('click',function(){
chart.removeAnnotation(chart.currentAnnotation)
})
}
}
},
navigation:{
//other events are skipped here
events: {
showPopup: function(event){
if (!this.annotationsPopupContainer) {
this.annotationsPopupContainer=them.toolbarPopup.current;
}
if (event.formType === 'annotation-toolbar') {
this.chart.currentAnnotation = event.annotation;
}
}
}
}
вышеупомянутая конфигурация удаляет аннотацию правильно, но как только я пытаюсь добавить другую аннотацию, появляется ошибка диаграммы.