Vue.js 无法在apex图表中获取数据
我试图在我的vue js应用程序中使用apex图表的样条面积图,并在应用程序的已创建部分以时间戳的格式从Firestore中提取日期,并在x轴上显示,但在x轴上不显示时间戳并给出错误。 这是密码Vue.js 无法在apex图表中获取数据,vue.js,google-cloud-firestore,apexcharts,Vue.js,Google Cloud Firestore,Apexcharts,我试图在我的vue js应用程序中使用apex图表的样条面积图,并在应用程序的已创建部分以时间戳的格式从Firestore中提取日期,并在x轴上显示,但在x轴上不显示时间戳并给出错误。 这是密码 export default { data() { return { options : { year: "numeric", month: "numeric", day: "numeric" }, times
export default {
data() {
return {
options : { year: "numeric", month: "numeric",
day: "numeric" },
timestamp:[],
RecruiterChart: {
series: [{
name: 'Total Jobs Posted',
data: [11, 32, 45, 32, 34, 52, 41]
}, {
name: 'Applied Candidates',
data: [31, 40, 28, 51, 42, 109, 100]
}],
chartOptions: {
dataLabels: {
enabled: false
},
stroke: {
curve: 'smooth'
},
colors: themeColors,
xaxis: {
type: 'datetime',
categories: []
},
tooltip: {
x: {
format: 'dd/MM/yyyy'
},
}
}
},
}
},
components: {
VueApexCharts
},
created(){
const thisIns = this;
var u= firebase.auth().currentUser
let Ref=firebase.firestore().collection("Recruiter").doc(u.uid).collection("Jobs")
Ref.orderBy("timestamp", "desc").onSnapshot(function(snapshot){
$.each(snapshot.docChanges(), function(){
var change= this
if(change.type==="added"){
var ab = change.doc.data().timestamp.toDate().toLocaleString("en-CH", thisIns.options)
thisIns.time.push(ab)
thisIns.RecruiterChart.chartOptions.xaxis.categories.push(
ab
)
console.log( thisIns.RecruiterChart.chartOptions.xaxis.categories)
}
})
})
console.log(thisIns.RecruiterChart.chartOptions.xaxis.categories)
},
}
但图表给出了错误
错误:属性cx:预期长度,“NaN”