Hide labels in Online Presence #569
This commit is contained in:
@@ -1,11 +1,8 @@
|
|||||||
function pia_draw_graph_online_history(pia_js_graph_online_history_time, pia_js_graph_online_history_ondev, pia_js_graph_online_history_dodev, pia_js_graph_online_history_ardev) {
|
function pia_draw_graph_online_history(pia_js_graph_online_history_time, pia_js_graph_online_history_ondev, pia_js_graph_online_history_dodev, pia_js_graph_online_history_ardev) {
|
||||||
var xValues = pia_js_graph_online_history_time;
|
var xValues = pia_js_graph_online_history_time;
|
||||||
new Chart("OnlineChart", {
|
|
||||||
type: "bar",
|
// Data object for online status
|
||||||
scaleIntegersOnly: true,
|
onlineData = {
|
||||||
data: {
|
|
||||||
labels: xValues,
|
|
||||||
datasets: [{
|
|
||||||
label: 'Online',
|
label: 'Online',
|
||||||
data: pia_js_graph_online_history_ondev,
|
data: pia_js_graph_online_history_ondev,
|
||||||
borderColor: "rgba(0, 166, 89)",
|
borderColor: "rgba(0, 166, 89)",
|
||||||
@@ -14,19 +11,58 @@ function pia_draw_graph_online_history(pia_js_graph_online_history_time, pia_js_
|
|||||||
pointStyle: 'circle',
|
pointStyle: 'circle',
|
||||||
pointRadius: 3,
|
pointRadius: 3,
|
||||||
pointHoverRadius: 3
|
pointHoverRadius: 3
|
||||||
}, {
|
};
|
||||||
|
|
||||||
|
// Data object for offline status
|
||||||
|
offlineData = {
|
||||||
label: 'Offline/Down',
|
label: 'Offline/Down',
|
||||||
data: pia_js_graph_online_history_dodev,
|
data: pia_js_graph_online_history_dodev,
|
||||||
borderColor: "rgba(222, 74, 56)",
|
borderColor: "rgba(222, 74, 56)",
|
||||||
fill: true,
|
fill: true,
|
||||||
backgroundColor: "rgba(222, 74, 56, .6)",
|
backgroundColor: "rgba(222, 74, 56, .6)",
|
||||||
}, {
|
};
|
||||||
|
|
||||||
|
// Data object for archived status
|
||||||
|
archivedData = {
|
||||||
label: 'Archived',
|
label: 'Archived',
|
||||||
data: pia_js_graph_online_history_ardev,
|
data: pia_js_graph_online_history_ardev,
|
||||||
borderColor: "rgba(220,220,220)",
|
borderColor: "rgba(220,220,220)",
|
||||||
fill: true,
|
fill: true,
|
||||||
backgroundColor: "rgba(220,220,220, .6)",
|
backgroundColor: "rgba(220,220,220, .6)",
|
||||||
}]
|
};
|
||||||
|
|
||||||
|
// Array to store datasets
|
||||||
|
datasets = [];
|
||||||
|
|
||||||
|
// Get UI presence settings
|
||||||
|
showStats = getSetting("UI_PRESENCE");
|
||||||
|
|
||||||
|
// Check if 'online' status should be displayed
|
||||||
|
if(showStats.includes("online"))
|
||||||
|
{
|
||||||
|
datasets.push(onlineData); // Add onlineData to datasets array
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if 'offline' status should be displayed
|
||||||
|
if(showStats.includes("offline"))
|
||||||
|
{
|
||||||
|
datasets.push(offlineData); // Add offlineData to datasets array
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if 'archived' status should be displayed
|
||||||
|
if(showStats.includes("archived"))
|
||||||
|
{
|
||||||
|
datasets.push(archivedData); // Add archivedData to datasets array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
new Chart("OnlineChart", {
|
||||||
|
type: "bar",
|
||||||
|
scaleIntegersOnly: true,
|
||||||
|
data: {
|
||||||
|
labels: xValues,
|
||||||
|
datasets: datasets
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
legend: {
|
legend: {
|
||||||
|
|||||||
Reference in New Issue
Block a user