#chart.js
Вопрос:
Я получаю эту ошибку:
Uncaught TypeError: Cannot read properties of undefined (reading 'tension') at vo.updateControlPoints (chart.min.js:13) at oo.draw (chart.min.js:13) at Yn._drawDataset (chart.min.js:13) at Yn._drawDatasets (chart.min.js:13) at Yn.draw (chart.min.js:13) at Yn.render (chart.min.js:13) at Yn.update (chart.min.js:13) at chart.min.js:13 at Yn._doResize (chart.min.js:7) at Yn._resize (chart.min.js:13)
А вот и javascript:
lt;script type="text/javascript"gt; if($("#callFrequency").length gt; 0) { var graphData = { labels : ["8:00","9:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00"], datasets : [ { label : '9th of November', borderColor : "#0dcaf0", pointBorderColor :"#0dcaf0", backgroundColor: "#0dcaf0", fill: false, tension: 0.1, data : [2,5,3,9,5,3,5,3,6,2,1,4,1] }, { label : '10th of November', borderColor : "#6c757d", pointBorderColor :"#6c757d", backgroundColor: "#6c757d", fill: false, tension: 0.1, data : [1,4,6,3,8,7,8,5,10,9,4,10,8] }, { label : '11th of November', borderColor : "#343a40", pointBorderColor :"#343a40", backgroundColor: "#343a40", fill: false, tension: 0.1, data : [1,2,6,3,4,2,12,4,7,2,4,2,4] }, { label : '12th of November', borderColor : "#0d6efd", pointBorderColor :"#0d6efd", backgroundColor: "#0d6efd", fill: false, tension: 0.1, data : [3,1,8,3,5,3,4,5,7,3,4,5,3] }, { label : '15th of November', borderColor : "#0dcaf0", pointBorderColor :"#0dcaf0", backgroundColor: "#0dcaf0", fill: false, tension: 0.1, data : [20,6,3,7,7,3,5,15,9,6,5,1,3,1] }, { label : '16th of November', borderColor : "#ffc107", pointBorderColor :"#ffc107", backgroundColor: "#ffc107", fill: false, tension: 0.1, data : [4,5,7,5,5,5,6,8,5,1,2,2] }, { label : '17th of November', borderColor : "#dc3545", pointBorderColor :"#dc3545", backgroundColor: "#dc3545", fill: false, tension: 0.1, data : [4,4,6,6,2,4,1,4,4,3,2,1] }, { label : '18th of November', borderColor : "#000000", pointBorderColor :"#000000", backgroundColor: "#000000", fill: false, tension: 0.1, data : [5,5,4,2,3,3,5,2,1,2,3,2] }, { label : '19th of November', borderColor : "#0000FF", pointBorderColor :"#0000FF", backgroundColor: "#0000FF", fill: false, tension: 0.1, data : [4,10,5,1,5,4,6,4,6,5,1,3,1] }, { label : '22nd of November', borderColor : "#800080", pointBorderColor :"#800080", backgroundColor: "#800080", fill: false, tension: 0.1, data : [7,2,5,8,6,6,1,5,4,5,4,1,1,1] }, { label : '23rd of November', borderColor : "#FF0000", pointBorderColor :"#FF0000", backgroundColor: "#FF0000", fill: false, tension: 0.1, data : [2,2,3,8,11,9,9,5,2,3,1,4,3] }, ] } var options = { animation: false, legend: { display: true, labels: { boxWidth: 10, boxHeight: 1 } }, maintainAspectRatio: false, responsive: true }; var callFrequencyElement = $("#callFrequency"); var callFrequencyVar = new Chart(callFrequencyElement, { type: 'line', data: graphData, options: options }); } lt;/scriptgt;
На диаграмме отображается пустая диаграмма, но на ней нет линий. Это произошло только тогда, когда я изменил свой CDN ChartJS с версии 2.5 на 3.0.0.
Насколько я вижу, в JS нет ошибок, но почему я получаю эту ошибку? Гистограммы отображаются совершенно нормально, только эта линейчатая диаграмма вызывает проблемы.