mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Use random colors in client graph if presets run out
Signed-off-by: Mark Drobnak <newtoncat12@yahoo.com>
This commit is contained in:
@@ -461,7 +461,17 @@ function updateClientsOverTime() {
|
||||
|
||||
for (i = clientsChart.data.datasets.length; plotdata.length && i < plotdata[0].length; i++)
|
||||
{
|
||||
clientsChart.data.datasets.push({data: [], backgroundColor: colors[i], pointRadius: 0, pointHitRadius: 5, pointHoverRadius: 5, label: labels[i], cubicInterpolationMode: "monotone" });
|
||||
clientsChart.data.datasets.push({
|
||||
data: [],
|
||||
backgroundColor: i < colors.length
|
||||
? colors[i]
|
||||
: '#' + parseInt("" + Math.random() * 0xffffff, 10).toString(16).padStart(6, "0"),
|
||||
pointRadius: 0,
|
||||
pointHitRadius: 5,
|
||||
pointHoverRadius: 5,
|
||||
label: labels[i],
|
||||
cubicInterpolationMode: "monotone"
|
||||
});
|
||||
}
|
||||
|
||||
// Add data for each dataset that is available
|
||||
|
||||
Reference in New Issue
Block a user