[Chartjs]-How to color legend in angular-chart.js

2πŸ‘

βœ…

It seems you are missing the reference to a style sheet in your html file. angular-chart.css

1πŸ‘

I did the following:

$ git clone https://github.com/jtblin/angular-chart.js.git
$ npm install
$ bower install

Then open angular-chart.js\examples\charts.html

Change

<canvas id="pie" class="chart chart-pie chart-xs" chart-data="data" chart-labels="labels"></canvas>

to

<canvas id="pie" class="chart chart-pie chart-xs" chart-data="data" chart-labels="labels" chart-legend="true"></canvas>

And the chart has a legend with colors. Your CSS seems to be different than the one in official distribution.

Leave a comment