arrays - Customize legend AngularJS -


i want draw bar chart in angularjs

this html:

<canvas id="bar" class="chart chart-bar" chart-data="datta" chart-labels="labels" chart-legend="true">                 </canvas>    

i haven't used chart library, idea want customize legend , want declare array data

$scope.legend = ["item1", "item2"] 

and array want display below chart. there way ?

thanks in advance!

i'm not sure if got it. if you're trying set legends of graph need set in chart options, not setting chart-legend true. you're html should like:

<canvas id="bar" class="chart chart-bar" chart-data="datta" chart-labels="labels" chart-options="chart-options"></canvas>   

than need create $scope.chart-options like:

$scope.chart-options = {     legend: {         display: true,     }, }; 

you can have more info here: chartjs legend documentation


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -