Reputation: 911
i'm following this tutorial angular-charts for implements charts
but how to set my data based (x,y) value on $scope.data?
i'm stack, please help me
Upvotes: 1
Views: 305
Reputation: 1625
For bar chart you may try as below:
<canvas id="locationBar" class="chart chart-bar" data="chartParams.votes" labels="chartParams.listOfLocations" series="chartParams.series" colours="chartParams.colours" options="chartParams.options"></canvas>
With the following angular code (in a controller of course)
$scope.chartParams = {
listOfLocations: ['Trenzalore','Earth','Caprica','Sol','Tau Ceti'],
votes: [[5,10,6,7,2]],
series: ["Nice Places"],
colours: [{fillColor:getRandomColour()}],
options: {barShowStroke : false}
};
You can change values of data
as per your requirement.
Go Here for more
Upvotes: 0