Chartjs-Angular chart js set fill color of bar chart

2👍

HTML attributes should be quoted by "". Also, it should be chart-dataset-override instead of chart-colours.

<canvas
  data-ng-show="graphType.bar"
  class="chart chart-bar graph"
  chart-data="dataProp"
  chart-labels="labels"
  chart-dataset-override="colorsEven">
</canvas>

To make chart-dataset-override work, chart-data must be an Array of data Arrays.

$scope.dataProp = [$scope.data];

1👍

As you can see in this post, the naming changed. If you are using angular-chart 1.0.3 the attribute is chart-colors.

Also, fillColor is now backgroundColor and you can use borderColor for the border’s color of the bar.

Leave a comment