ArgusSite/static/scripts/graphs.js
2023-08-14 07:11:03 +03:00

71 lines
1021 B
JavaScript

Chart.defaults.color = "rgba(0, 0, 0, 0.4)";
Chart.defaults.font.size = 15;
Chart.defaults.font.weight = 400;
var warningsOptions = {
plugins: {
legend: {
display: false,
},
},
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
grid: {
display: true,
color: "#D9D9D9",
},
},
x: {
grid: {
display: false,
},
},
},
};
new Chart("chart-warnings", {
type: "bar",
options: warningsOptions,
data: warningsData,
});
var positionsOptions = {
plugins: {
legend: {
display: false,
},
},
labelStep: "3",
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
stacked: true,
grid: {
display: true,
color: "#D9D9D9",
},
ticks: {
stepSize: 10000,
},
},
x: {
grid: {
display: false,
},
},
},
};
new Chart("chart-positions", {
type: "line",
data: positionsData,
options: positionsOptions,
});