<body ng-app="myApp">
<div ng-controller="MainController">
<div zingchart id="chart-1" zc-json="myJson" zc-width="100%" zc-height="500px"></div>
<div id="controls">
<section>
<label>Add random values : </label><button ng-click="addValues()"> append </button>
</section>
<section>
<label>Title Text : </label><input type="text" ng-model="myJson.title.text"/>
</section>
</div>
</div>
</body>
var app = angular.module('myApp', ['zingchart-angularjs']);
app.controller('MainController', function($scope) {
$scope.myJson = {
type : "bar",
title:{
backgroundColor : "transparent",
fontColor :"black",
text : "Hello world"
},
backgroundColor : "white",
series : [
{
values : [1,2,3,4],
backgroundColor : "#4DC0CF"
}
]
};
$scope.addValues = function(){
var val = Math.floor((Math.random() * 10));
console.log(val);
$scope.myJson.series[0].values.push(val);
}
});