Files
log_analysis_web/site/scripts/statistics/init.js
T

34 lines
732 B
JavaScript

function InitStatisticsChart(labels, colors) {
// Создаём чарт
let chart = new Chart(
document.getElementById("statistics-chart"), {
type: 'pie',
data: {
labels: labels,
datasets: [{
label: "Количество",
data: [0, 0],
backgroundColor: colors
}]
},
options: {
plugins: {
legend: {
display: false
}
}
}
}
);
// Отображаем чарт
chart.update();
return chart;
}
function InitStatistics(url) {
window.statistics = new Statistics(url);
window.total_logs_amount = document.getElementById("total-logs-amount");
}