Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePeltier committed Mar 16, 2022
1 parent 23c5723 commit 0f16c29
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 71 deletions.
88 changes: 31 additions & 57 deletions src/LukeWebsite/static/js/championDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,49 @@ $(function () {

var ctx = $championPlaytimeChart;

Chart.defaults.global.defaultFontColor='white';
Chart.defaults.global.defaultFontFamily = 'Gill Sans Light';

var championPlaytime = new Chart(ctx, {
Chart.defaults.color='white';
Chart.defaults.font.family='Gill Sans Light';
var championPlaytime = new Chart(ctx,
{
type: 'bar',
data: {
labels: data.labels,
datasets: [{
label: 'Overall',
data: data.overall,
fill: false,
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmanspurple')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmanspurple')
}, {
label: 'Top',
data: data.top,
fill: false,
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansred')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansred')
}, {
label: 'Jungle',
data: data.jungle,
fill: false,
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansorange')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansorange')
}, {
label: 'Middle',
data: data.mid,
fill: false,
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansyellow')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansyellow')
}, {
label: 'Bottom',
data: data.bot,
fill: false,
data: data.overall.concat(data.top, data.jungle, data.mid, data.bot, data.support),
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansgreen')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansgreen')
}, {
label: 'Support',
data: data.support,
fill: false,
borderWidth: 1,
minBarLength: 5,
backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansblue')+ "33",
borderColor: getComputedStyle(document.documentElement).getPropertyValue('--tenmansblue')
backgroundColor: [
getComputedStyle(document.documentElement).getPropertyValue('--tenmanspurple') + "33",
getComputedStyle(document.documentElement).getPropertyValue('--tenmansred') + "33",
getComputedStyle(document.documentElement).getPropertyValue('--tenmansorange') + "33",
getComputedStyle(document.documentElement).getPropertyValue('--tenmansyellow') + "33",
getComputedStyle(document.documentElement).getPropertyValue('--tenmansgreen') + "33",
getComputedStyle(document.documentElement).getPropertyValue('--tenmansblue') + "33"
],
borderColor: [
getComputedStyle(document.documentElement).getPropertyValue('--tenmanspurple'),
getComputedStyle(document.documentElement).getPropertyValue('--tenmansred'),
getComputedStyle(document.documentElement).getPropertyValue('--tenmansorange'),
getComputedStyle(document.documentElement).getPropertyValue('--tenmansyellow'),
getComputedStyle(document.documentElement).getPropertyValue('--tenmansgreen'),
getComputedStyle(document.documentElement).getPropertyValue('--tenmansblue')
]
}]
},
options: {
responsive: true,
title: {
display: true,
text: 'Playtime Bar Chart'
plugins: {
title: {
display: true,
text: 'Playtime Bar Chart'
}
},
scales: {
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 5
}
}]
y: {
suggestedMin: 0,
suggestedMax: 5
}
}
}
});
Expand Down
21 changes: 10 additions & 11 deletions src/LukeWebsite/static/js/lane_matchup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ $(function () {

var ctx = $laneMatchupChart;

Chart.defaults.global.defaultFontColor='white';
Chart.defaults.global.defaultFontFamily = 'Gill Sans Light';
Chart.defaults.color='white';
Chart.defaults.font.family='Gill Sans Light';
var laneMatchup = new Chart(ctx, {
type: 'horizontalBar',
type: 'bar',
data: {
labels: data.labels,
datasets: [{
Expand All @@ -28,18 +28,17 @@ $(function () {
}]
},
options: {
indexAxis: 'y',
responsive: true,
scales: {
xAxes: [{
x: {
stacked: true,
ticks: {
min: 0,
max: 100
}
}],
yAxes: [{
min: 0,
max: 100
},
y: {
stacked: true,
}]
}
},
title: {
display: true,
Expand Down
2 changes: 0 additions & 2 deletions src/LukeWebsite/static/js/playerWOTGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ $(function () {
x:{
grid: {
color: function(context) {
console.log(data.seasons)
console.log(context.tick.value)
if(data.seasons.indexOf(context.tick.value+1)!==-1){
return getComputedStyle(document.documentElement).getPropertyValue('--tenmanshighlightbold');
}
Expand Down
5 changes: 4 additions & 1 deletion src/LukeWebsite/tenMans/templates/tenMans/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
{% bootstrap_css %}
{% comment %} {% bootstrap_javascript %} {% endcomment %}
<script crossorigin="anonymous" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>


{% load static %}
Expand Down
4 changes: 4 additions & 0 deletions src/LukeWebsite/tenMans/views/base_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def get(self, request, *args, **kwargs):
playerDict["botAlpha"] = player.getLaneRate(Lane.objects.get(laneName__exact="Bot"), season)
playerDict["suppAlpha"] = player.getLaneRate(Lane.objects.get(laneName__exact="Support"), season)
playerDict["playerID"] = player.id
if(playerDict["overall"] == "N/A"):
continue
data.append(playerDict)

return JsonResponse(data={
Expand Down Expand Up @@ -90,6 +92,8 @@ def get(self, request, *args, **kwargs):
playerDict["bot"] = player.getLaneCount(Lane.objects.get(laneName__exact="Bot"), season)
playerDict["supp"] = player.getLaneCount(Lane.objects.get(laneName__exact="Support"), season)
playerDict["playerID"] = player.id
if(playerDict["overall"] == 0):
continue
data.append(playerDict)

return JsonResponse(data={
Expand Down

0 comments on commit 0f16c29

Please sign in to comment.