mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Depending on how many devices are contained in the list, the y-axis may contain floating point numbers. This does not make sense.
65 lines
2.1 KiB
JavaScript
Executable File
65 lines
2.1 KiB
JavaScript
Executable File
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;
|
|
new Chart("OnlineChart", {
|
|
type: "bar",
|
|
scaleIntegersOnly: true,
|
|
data: {
|
|
labels: xValues,
|
|
datasets: [{
|
|
label: 'Online',
|
|
data: pia_js_graph_online_history_ondev,
|
|
borderColor: "rgba(0, 166, 89)",
|
|
fill: true,
|
|
backgroundColor: "rgba(0, 166, 89, .6)",
|
|
pointStyle: 'circle',
|
|
pointRadius: 3,
|
|
pointHoverRadius: 3
|
|
}, {
|
|
label: 'Offline/Down',
|
|
data: pia_js_graph_online_history_dodev,
|
|
borderColor: "rgba(222, 74, 56)",
|
|
fill: true,
|
|
backgroundColor: "rgba(222, 74, 56, .6)",
|
|
}, {
|
|
label: 'Archived',
|
|
data: pia_js_graph_online_history_ardev,
|
|
borderColor: "rgba(220,220,220)",
|
|
fill: true,
|
|
backgroundColor: "rgba(220,220,220, .6)",
|
|
}]
|
|
},
|
|
options: {
|
|
legend: {
|
|
display: true,
|
|
labels: {
|
|
fontColor: "#A0A0A0",
|
|
}
|
|
},
|
|
scales: {
|
|
yAxes: [{
|
|
ticks: {
|
|
beginAtZero:true,
|
|
fontColor: '#A0A0A0'
|
|
},
|
|
gridLines: {
|
|
color: "rgba(0, 0, 0, 0)",
|
|
},
|
|
stacked: true,
|
|
}],
|
|
xAxes: [{
|
|
ticks: {
|
|
fontColor: '#A0A0A0',
|
|
},
|
|
gridLines: {
|
|
color: "rgba(0, 0, 0, 0)",
|
|
},
|
|
stacked: true,
|
|
}],
|
|
},
|
|
tooltips: {
|
|
mode: 'index'
|
|
}
|
|
}
|
|
});
|
|
}
|