Chartjs-My choice of color is not used in my stacked bar chart

0๐Ÿ‘

โœ…

I found the solution.
I have to specify the colors outside of the datasets like the following:

this.realTimeUsage.Colors = [
  {
    backgroundColor: ["rgba(255, 165, 0, 1)"]
  },
  {
    backgroundColor: ["rgba(171, 219, 0, 1)"]
  },
  {
    backgroundColor: ["rgba(253, 216, 53, 1)"]
  }
];

Leave a comment