diff --git a/main.py b/main.py index d435eb3..dc023f6 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ users = { } def get_game_data(): - res = requests.get("https://botbattle.be/api/games") + res = requests.get("https://botbattle.be/api/games?num=5000") return sorted(res.json(), key=lambda x: x['gid']) def get_data(): @@ -47,7 +47,8 @@ def process_game_data(game_data): 'bots': bots, 'min_elo': min_elo, 'max_elo': max_elo, - 'game': game_data[-1]['gid'], + 'min_game': game_data[0]['gid'], + 'max_game': game_data[-1]['gid'], } def filter_date(data): diff --git a/templates/index.html b/templates/index.html index 9d86326..1c970c9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -99,9 +99,9 @@ ctx.lineWidth = 4 ctx.strokeStyle = bot.color_ring ctx.beginPath() - ctx.moveTo(getX(width, margin, 0, graph_data.game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0])) + ctx.moveTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0])) for (let i = 1; i < bot.x.length; i++) { - ctx.lineTo(getX(width, margin, 0, graph_data.game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i])) + ctx.lineTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i])) } ctx.stroke() }