Chartjs-Customize legend AngularJS

0👍

I’m not sure if I got it. If you’re trying to set the legends of the graph you need to set it in the chart options, not setting chart-legend to true. You’re html should be like:

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

Than you need to create a $scope.chart-options like:

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

You can have more info here: Chartjs legend documentation

Leave a comment