change/combat rank graph
This commit is contained in:
3 files changed
+36
-13
No files matched your search
+34
-11
@@ -208,22 +208,45 @@ module.exports = {
|
||||
statsEmbed.addFields({ name: 'Combat Rating', value: `${query.combatRating}`, inline: true });
|
||||
|
||||
const chart = {
|
||||
type: 'bar',
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: new Array(query.combatRatingHistory),
|
||||
datasets: [
|
||||
{
|
||||
type: 'line',
|
||||
label: 'Combat Rating over time',
|
||||
borderColor: 'rgb(54, 162, 235)',
|
||||
borderWidth: 2,
|
||||
fill: false,
|
||||
data: query.combatRatingHistory,
|
||||
datasets: [{
|
||||
data: query.combatRating,
|
||||
label: 'Combat Rating Over Time',
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
layout: {
|
||||
padding: {
|
||||
right: 40,
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: {
|
||||
datalabels: {
|
||||
display: true,
|
||||
align: 'top',
|
||||
color: '#000',
|
||||
backgroundColor: '#ccc',
|
||||
borderRadius: 4,
|
||||
offset: 10,
|
||||
display: (context) => {
|
||||
const index = context.dataIndex;
|
||||
const value = context.dataset.data[index];
|
||||
const min = Math.min.apply(null, context.dataset.data);
|
||||
const max = Math.max.apply(null, context.dataset.data);
|
||||
return (
|
||||
index == 0 ||
|
||||
index == context.dataset.data.length - 1 ||
|
||||
value == min ||
|
||||
value == max
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
const encodedChart = encodeURIComponent(JSON.stringify(chart));
|
||||
const chartURL = `https://quickchart.io/chart?c=${encodedChart}`;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayzr-bot",
|
||||
"version": "12.2.3",
|
||||
"version": "12.2.4",
|
||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ module.exports = {
|
||||
if (!client.exists(playerStat.shotsLanded)) playerStat = insertPVPstats(playerStat);
|
||||
if (!client.exists(attackerStat.shotsLanded)) attackerStat = insertPVPstats(attackerStat);
|
||||
|
||||
// Update in depth PVP stats if non Melee weapon\
|
||||
// Update in depth PVP stats if non Melee weapon
|
||||
if (info.weapon.includes("Sawed-off")) info.weapon = info.weapon.split("Sawed-off ")[1];
|
||||
if (info.weapon in playerStat.weaponStats) {
|
||||
playerStat.timesShot++;
|
||||
|
||||
Reference in new issue
Block a user