Creating bar charts in ionic by taking the values from local storage


I want to create a chart showing the different accounts and their balances.
The accounts and balance are stored in local storage
Now I want to use these values and represent in the chart form,also the balance is updating after every transaction.
so my question is how to create chart which takes values from the local storage and represent them in the chart form …

]).then((things) => {
  makeChart(things[0], things[1]);



If thing1,thing2 are different are different account name i think,if so how do i make sure that how many accounts are there??
Like till where should i make my n updated…
Please elaborate it


Promise.all takes an array. It can be as big as you want it to be.


this.barChart=new Chart(this.barCanvas.nativeElement,

]).then((accountname) => {
  Chart(accountname[0], accountname[1]);

It gives me error,
also how to write labels and data separtely,which are dynamic,
My labels are accountname which are stored in the local storage,while the data are the balances which are also stored in local storage,

how to represent these values in the bar chart…