Is there a way to incorporate data retrieved from axios into vue js data?
value: [parseInt(this.maintemp1),parseInt( this.maintemp2)], <--------This is where I'm facing an issue
export default {
data: () => ({
maincity: "",
maintemp1: "",
maintemp2: "",
maindate1: "",
showLabels: true,
lineWidth: 2,
labelSize: 7,
radius: 10,
padding: 8,
lineCap: "round",
gradient: gradients[5],
value: [parseInt(this.maintemp1),parseInt( this.maintemp2)], <--------This is where I'm encountering a problem
gradientDirection: "top",
gradients,
fill: true,
type: "trend",
autoLineWidth: false
}),
mounted() {
axios
.get(
"http://api.openweathermap.org/data/2.5/forecast?q=khiva&units=metric&appid=myapi"
)
.then(response => {
this.wholeResponse = response.data.Search;
this.maincity = response.data.city.name;
this.maindate1 = response.data.list[1].dt_txt;
this.maintemp1 = response.data.list[1].main.temp;
this.maintemp2 = response.data.list[9].main.temp;
})
.catch(error => {
console.log(error);
});
}
};