change/combat rank graph
This commit is contained in:
3 files changed
+35
-12
No files matched your search
+33
-10
@@ -208,19 +208,42 @@ module.exports = {
|
|||||||
statsEmbed.addFields({ name: 'Combat Rating', value: `${query.combatRating}`, inline: true });
|
statsEmbed.addFields({ name: 'Combat Rating', value: `${query.combatRating}`, inline: true });
|
||||||
|
|
||||||
const chart = {
|
const chart = {
|
||||||
type: 'bar',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
labels: new Array(query.combatRatingHistory),
|
labels: new Array(query.combatRatingHistory),
|
||||||
datasets: [
|
datasets: [{
|
||||||
{
|
data: query.combatRating,
|
||||||
type: 'line',
|
label: 'Combat Rating Over Time',
|
||||||
label: 'Combat Rating over time',
|
}],
|
||||||
borderColor: 'rgb(54, 162, 235)',
|
},
|
||||||
borderWidth: 2,
|
options: {
|
||||||
fill: false,
|
layout: {
|
||||||
data: query.combatRatingHistory,
|
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
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayzr-bot",
|
"name": "dayzr-bot",
|
||||||
"version": "12.2.3",
|
"version": "12.2.4",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
+1
-1
@@ -178,7 +178,7 @@ module.exports = {
|
|||||||
if (!client.exists(playerStat.shotsLanded)) playerStat = insertPVPstats(playerStat);
|
if (!client.exists(playerStat.shotsLanded)) playerStat = insertPVPstats(playerStat);
|
||||||
if (!client.exists(attackerStat.shotsLanded)) attackerStat = insertPVPstats(attackerStat);
|
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.includes("Sawed-off")) info.weapon = info.weapon.split("Sawed-off ")[1];
|
||||||
if (info.weapon in playerStat.weaponStats) {
|
if (info.weapon in playerStat.weaponStats) {
|
||||||
playerStat.timesShot++;
|
playerStat.timesShot++;
|
||||||
|
|||||||
Reference in new issue
Block a user