fix new client graph for smaller screen sizes

This commit is contained in:
RaidMax 2022-03-29 18:59:27 -05:00
parent 1e67f6e86c
commit 25fb5fdc14
2 changed files with 2 additions and 5 deletions

View File

@ -73,7 +73,7 @@
</div>
<div class="row server-history mb-4">
<div class="server-history-row" style="position:relative; width: 80vw" id="server_history_@Model.ID" data-serverid="@Model.ID"
<div class="server-history-row m-auto" style="position:relative; width: 100%" id="server_history_@Model.ID" data-serverid="@Model.ID"
data-clienthistory='@Html.Raw(Json.Serialize(Model.ClientHistory))'
data-clienthistory-ex='@Html.Raw(Json.Serialize(Model.ClientHistory.ClientCounts))'
data-online="@Model.Online">

View File

@ -105,16 +105,13 @@ function getPlayerHistoryChart(playerHistory, i, width, maxClients) {
options: {
responsive: true,
maintainAspectRatio: false,
onResize: function(chart, size) {
console.log(size);
},
legend: false,
defaultFontFamily: '-apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
tooltips: {
callbacks: {
// todo: localization at some point
title: context => moment(context[0].label).local().calendar(),
label: context => context.datasetIndex !== 1 ? `${context.value} players on ${playerHistory[context.index].mapAlias}` : context.value === '0' ? '' : 'Server Unreachable!',
title: context => context[0].datasetIndex !== 1 ? moment(context[0].label).local().calendar() : ''
},
mode: 'nearest',
intersect: false,