Переносил API для графика apexchart через axios и выдает ошибку
Uncaught (in promise) TypeError: chart.updateSeries is not a function
at eval (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader-v16/dist/index.js?!./src/components/TheChart.vue?vue&type=script&lang=js:42:13)
Все делал как в инструкции, но выдает это, подскажите почему?
import VueApexCharts from "vue3-apexcharts";
import axios from 'axios';
export default {
components: {
apexchart: VueApexCharts,
},
data: function() {
return {
chartOptions: {
chartapex: {
id: "vuechart-example",
},
chart: {
height: 350,
type: 'bar',
},
title: {
text: 'Ajax Example',
},
noData: {
text: 'Loading...'
},
dataLabels: {
enabled: false
},
},
series: [],
};
},
mounted() {
var url = 'http://my-json-server.typicode.com/apexcharts/apexcharts.js/yearly';
var chart = document.querySelector('.chart')
axios({
method: 'GET',
url: url,
}).then(function(response) {
chart.updateSeries([{
name: 'Sales',
data: response.data
}])
})
}
};