mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
misc performance graph display tweaks
This commit is contained in:
@ -124,11 +124,12 @@
|
||||
var spm = Model.ServerId != null ? serverLegacyStat?.SPM.ToNumericalString() : Model.LegacyStats.WeightValueByPlaytime(nameof(EFClientStatistics.SPM), 0).ToNumericalString();
|
||||
|
||||
var performanceHistory = Model.Ratings
|
||||
.OrderBy(rating => rating.CreatedDateTime)
|
||||
.Select(rating => new PerformanceHistory { Performance = rating.PerformanceMetric, OccurredAt = rating.CreatedDateTime });
|
||||
|
||||
if (performance != null)
|
||||
if (performance != null && performance != Model.Ratings.FirstOrDefault().PerformanceMetric)
|
||||
{
|
||||
performanceHistory = performanceHistory.Append(new PerformanceHistory { Performance = performance.Value, OccurredAt = DateTime.UtcNow });
|
||||
performanceHistory = performanceHistory.Append(new PerformanceHistory { Performance = performance.Value, OccurredAt = Model.Ratings.FirstOrDefault()?.CreatedDateTime ?? DateTime.UtcNow });
|
||||
}
|
||||
|
||||
var score = allPerServer.Any()
|
||||
@ -285,7 +286,7 @@
|
||||
<!-- history graph -->
|
||||
@if (performanceHistory.Count() > 5)
|
||||
{
|
||||
<div class="w-half m-auto ml-lg-auto " id="client_performance_history_container">
|
||||
<div class="w-full w-lg-half m-auto ml-lg-auto" id="client_performance_history_container">
|
||||
<canvas id="client_performance_history" data-history="@(JsonSerializer.Serialize(performanceHistory))"></canvas>
|
||||
</div>
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
@using IW4MAdmin.Plugins.Stats
|
||||
@using System.Text.Json.Serialization
|
||||
@using System.Text.Json
|
||||
@model List<IW4MAdmin.Plugins.Stats.Web.Dtos.TopStatsInfo>
|
||||
@{
|
||||
@ -86,7 +85,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full w-md-half client-rating-graph pt-10 pb-10">
|
||||
<canvas id="rating_history_@(stat.ClientId + "_" + stat.Id)" data-history="@(JsonSerializer.Serialize(stat.PerformanceHistory))"></canvas>
|
||||
<canvas id="rating_history_@(stat.ClientId + "_" + stat.Id)" data-history="@(JsonSerializer.Serialize(stat.PerformanceHistory.OrderBy(perf => perf.OccurredAt)))"></canvas>
|
||||
</div>
|
||||
<div class="w-quarter align-self-center d-flex justify-content-center">
|
||||
<img class="w-100 h-100" src="~/images/stats/ranks/rank_@(stat.ZScore.RankIconIndexForZScore()).png" alt="@stat.Performance"/>
|
||||
|
@ -26,7 +26,7 @@ function setupPerformanceGraph() {
|
||||
}
|
||||
const chart = $('#client_performance_history');
|
||||
const container = $('#client_performance_history_container');
|
||||
chart.attr('height', summary.height());
|
||||
chart.attr('height', summary.height() * 1.5);
|
||||
chart.attr('width', container.width());
|
||||
renderPerformanceChart();
|
||||
}
|
||||
@ -394,7 +394,7 @@ function renderPerformanceChart() {
|
||||
position: 'right',
|
||||
ticks: {
|
||||
precision: 0,
|
||||
stepSize: 3,
|
||||
stepSize: max - min / 2,
|
||||
callback: function (value, index, values) {
|
||||
if (index === values.length - 1) {
|
||||
return min;
|
||||
|
@ -88,7 +88,7 @@ function getStatsChart(id) {
|
||||
position: 'right',
|
||||
ticks: {
|
||||
precision: 0,
|
||||
stepSize: 3,
|
||||
stepSize: max - min / 2,
|
||||
callback: function (value, index, values) {
|
||||
if (index === values.length - 1) {
|
||||
return min;
|
||||
|
Reference in New Issue
Block a user