Good luck with. you made the design beautiful.
Inside the “dashboard-status-page.twig” file.
var displayStatusChart = new Chart($("#displayStatusChart"), {
type: ‘doughnut’,
data: {
datasets: [{
data: displayData,
backgroundColor: ["rgb(0,255,0)", "rgb(255,0,0)"]
}],
labels: ["Online", "Offline"]
},
options: {
maintainAspectRatio: false
}
});
var displayContentChart = new Chart($("#displayContentChart"), {
type: ‘doughnut’,
data: {
datasets: [{
data: displayMediaStatusData,
backgroundColor: ["rgb(0,255,0)", "rgb(255,0,0)"]
}],
labels: ["Up to Date", "Not up to date"]
},
options: {
maintainAspectRatio: false
}
});
var coloursDG = ;
for(var i = 0; i < displayGroupNames.length; i++) {
coloursDG.push($c.rand());
}
for(var i = 0; i < libraryData.length; i++) {
colours.push($c.rand());
}
var libraryChart = new Chart($("#libraryChart"), {
type: ‘pie’,
data: {
datasets: [{
data: libraryData,
backgroundColor: colours
}],
labels: {{ libraryWidgetLabels|raw }}
},
options: {
maintainAspectRatio: false
}
});
random colors are given here. You can set them yourself. but you have to call them according to the number of content.
backgroundColor: ["rgb(0,255,0)", "rgb(255,0,0)"]
With this code, you change individual colors. For individual content, it will be sufficient for me to specify rgb colors.
colours.push($c.rand());
With this code, you change multiple colors.
To do this you need to disable the random command and create an array with colors instead. “colors” array and “colorsDG” array. You need to add a color scale for these two arrays.