mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
Add automated ban offense for anti-cheat
add EFClientStatHistory and EFClientAverageStatHistory for tracking change of stats over time
This commit is contained in:
61
WebfrontCore/wwwroot/js/stats.js
Normal file
61
WebfrontCore/wwwroot/js/stats.js
Normal file
@ -0,0 +1,61 @@
|
||||
function getStatsChart(id, width, height) {
|
||||
const data = $('#' + id).data('history');
|
||||
let fixedData = [];
|
||||
data.forEach(function (item, i) {
|
||||
fixedData[i] = { x: i, y: item };
|
||||
});
|
||||
|
||||
return new CanvasJS.Chart(id, {
|
||||
backgroundColor: 'transparent',
|
||||
height: height,
|
||||
width: width,
|
||||
animationEnabled: false,
|
||||
toolTip: {
|
||||
contentFormatter: function (e) {
|
||||
return e.entries[0].dataPoint.y;
|
||||
}
|
||||
},
|
||||
axisX: {
|
||||
interval: 1,
|
||||
gridThickness: 0,
|
||||
lineThickness: 0,
|
||||
tickThickness: 0,
|
||||
margin: 0,
|
||||
valueFormatString: " "
|
||||
},
|
||||
axisY: {
|
||||
gridThickness: 0,
|
||||
lineThickness: 0,
|
||||
tickThickness: 0,
|
||||
minimum: Math.min(...data) - 15,
|
||||
maximum: Math.max(...data) + 15,
|
||||
margin: 0,
|
||||
valueFormatString: " ",
|
||||
labelMaxWidth: 0
|
||||
},
|
||||
legend: {
|
||||
maxWidth: 0,
|
||||
maxHeight: 0,
|
||||
dockInsidePlotArea: true
|
||||
},
|
||||
data: [{
|
||||
showInLegend: false,
|
||||
type: "splineArea",
|
||||
color: 'rgba(0, 122, 204, 0.25)',
|
||||
markerSize: 0,
|
||||
dataPoints: fixedData
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.client-rating-graph').each(function (i, element) {
|
||||
getStatsChart($(element).attr('id'), $(element).width(), $(element).height()).render();
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
$('.client-rating-graph').each(function (index, element) {
|
||||
getStatsChart($(element).attr('id'), $(element).width(), $(element).height()).render();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user