Using chartjs in ionic framework with firebase

I’m new at ionic framework.I want to use chartjs in my application
based on data stored in firebase. here is my code which I retrieve data
in list:

        <ion-item ng-repeat="item in items |reverse |limitTo:3">
          <b>  {{}}</b>
          <p> {{item.time}}</p>
          <p>  {{item.dayOfWeek}}</p

and have a canvas to show the data in chart:

also in my controller I have:

.factory(“Items”, function ($firebaseArray) {
var itemsRef = new Firebase(“https://[my-firebase- app]”);
return $firebaseArray(itemsRef);


.controller(“ListCtrl”, function ($scope, Items) {

$scope.items = Items;

$scope.addItem = function () {


  "bg": $scope.newBG,




the chart only work with static array data in controller, like this:

$scope.graph = {};
$ =
[16, 15, 20, 12, 16, 12, 8],

[8, 9, 4, 12, 8, 12, 14]

but I want to use dynamic data from firebase and when a data add in it, it shows in chart.
How Can I use that data and bind them to my chart where they are n Json format?
Is it right to use it like

but it doesn’t work.
in other word,How to retrieve json data stored in firebase, to an array in angularjs to show in chart.
Thank you for helping me