0👍
Isn’t that shown right here in the Demo showcase? https://www.primefaces.org/showcase/ui/chartjs/bar/bar.xhtml
List<String> bgColor = new ArrayList<>();
bgColor.add("rgba(255, 99, 132, 0.2)");
bgColor.add("rgba(255, 159, 64, 0.2)");
bgColor.add("rgba(255, 205, 86, 0.2)");
bgColor.add("rgba(75, 192, 192, 0.2)");
bgColor.add("rgba(54, 162, 235, 0.2)");
bgColor.add("rgba(153, 102, 255, 0.2)");
bgColor.add("rgba(201, 203, 207, 0.2)");
barDataSet.setBackgroundColor(bgColor);
- Chartjs-Updating chart.js based on selections from dropdown
- Chartjs-Chart.js, increase space between bars and its labels when increasing the charts width
Source:stackexchange.com