У меня есть функция удаления, и я хочу сохранить значение как новые данные в моем массиве, возможно ли это?
series: [{
name: 'Temperature',
type: 'spline',
connectNulls: true,
cursor: 'pointer',
data: [13, 54, 35, 24, 65, 81,13, 54, 35, 24, 65, 81,13, 54, 35, 24, 65, 81],
tooltip: {
valueSuffix: ' °C',
},
point: {
events: {
drag: function() {
document.getElementById('point-temp').value = (Math.round(this.y));
}
}
},
}]
This is how I show it in an input field :
<input placeholder="new Temperature" id="point-temp" type="text" class="field" value="">
This is the button to store the new point value in my array.
<button class="btn" id="save-data">Save to data</button>
и это функция для добавления новых данных в массив, но она не работает
document.getElementById('save-data').addEventListener('click', function(){
document.getElementById('point-temp').value;
chart.series[0].data(point);
});