I'm trying to load chartist data via api call, though the data is returned but does not load in chartist series.
// Initialize data series
seriesData: any[] = [];
// Function to retrieve data from api
getSeriesData() {
this.uid.getSeriesData(this.auth.getCurrentUser()).then(
data => this.seriesData = data, // This is populated
err => console.log(err)
);
}
//ngInit
ngOnInit() {
this.getSeriesData();
// Chartist
const dataDailySalesChart: any = {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
series: [
this.seriesData // THIS IS ALWAYS EMPTY
]
};
}