' + '
' + 'Time: ' + moment.utc((this.point.y * 60) * 1000).format('HH[H] mm[M]') + '
' + 'Percentage: '+ (this.point.percentage).toFixed(2) +'%'; } }, plotOptions: { pie: { cursor: 'pointer', dataLabels: { enabled: true, useHTML: true, formatter: function () { return ''; }, style: { fontFamily: 'Lato,sans-serif', fontSize: '12px', fontWeight: 'normal', color: '#535353', textShadow: false } } } }, }); /** Recently Played **/ $recentlyPlayed.highcharts({ chart: { type: 'column', backgroundColor: null, spacingBottom: 5, spacingTop: 15, spacingLeft: 0, spacingRight: 0 }, title: {text: ''}, credits: {enabled: false}, xAxis: { tickWidth: 0, tickPosition: 'inside', type: "category", labels: {useHTML: true} }, yAxis: { offset: 0, title: {text: ''}, labels: {enabled: false}, minorTickInterval: 'auto', minorGridLineColor: '#f3f3f3', tickColor: '#e9e9e9', startOnTick: true, endOnTick: true, stackLabels: { enabled: true, style: { fontWeight: 'bold', color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray' } } }, legend: { enabled: false }, tooltip: { headerFormat: '{point.x}
', pointFormat: '{series.name}: {point.y}
Total: {point.stackTotal}' }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: 'none' } } } }, series: [], }); /** Gamemode/Role Stats**/ $(".knob").knob({ readOnly: true, step: 0.5, width: "100%", bgColor: "#e9e9e9", fgColor: "#1e282f", max: 10.0, min: 0.0, thickness: 0.3, angleArc: 250, angleOffset: -125 }); var queueScores = $('#queue-scores').data('scores'); $('.queue-selector button').click(function (e) { if (!$(this).hasClass('active')) { $('.queue-selector button.active').removeClass('active'); $(this).addClass('active'); } updateQueueScores($(this).data('queue')); }); function updateQueueScores(queue) { $('#queue-scores > div').each(function (i, el) { if (queue in queueScores) { var season = Object.keys(queueScores[queue])[0]; var data = queueScores[queue][season]; var type = $(el).data('id'); var score = data[type]['percentile'] / 10; var knob = $("#queue-scores").find("[data-id='" + type + "'] .knob"); knob.val(score).trigger('change'); var fg = '#317331'; if (knob.val() < 5) { fg = '#af3f47'; } knob.trigger('configure', { fgColor: fg }); var percentile = 100 - data[type]['percentile']; if (isNaN(percentile)) { $(el).find('.per').text(''); } else { var perText = 'Top '; if (percentile > 50) { perText = 'Bot '; } percentile = percentile === 0 ? 0.01 : percentile.toFixed(2); $(el).find('.per').text(perText + percentile + '%'); } var average = data[type]['value'] - data[type]['average']; if (isNaN(average)) { $(el).find('.avg').text(''); } else { if (average > 100 || average < -100) { average = average.toFixed(0); } else { average = average.toFixed(2); } if (average > 0) { average = '+' + average; } $(el).find('.avg').text(average + ' AVG'); } } else { $("#queue-scores").find(".knob").val(0).trigger('change'); $(el).find('.avg').text('N/A'); $(el).find('.per').text(''); } }); } /** Change Elo **/ function changeElo(start, end){ $.ajax({ url: '//api.paladins.guru/v2/player/elo-chart', data: { player: player, region: region, queue: queue, start: start, end: end }, type: "get", dataType: "json", success: function(data){ $eloChart.highcharts({ chart: {type: 'spline', backgroundColor: null, spacingBottom: 5, spacingTop: 15, spacingLeft: 0}, title: {text: ''}, credits: {enabled: false}, legend: { enabled: false }, xAxis: { type: 'datetime', minTickInterval: 24 * 3600 * 1000, dateTimeLabelFormats: { month: '%b %e', year: '%b' }, title: {text: ''}, tickWidth: 1, tickPosition: 'inside', tickColor: '#e9e9e9', }, yAxis: { offset: -10, title: {text: ''}, minorTickInterval: 'auto', minorGridLineColor: '#f3f3f3', tickColor: '#e9e9e9', startOnTick: true, endOnTick: true, labels: { format: '{value:,.0f}' } }, series: data.results }); } }); } function changeRecentlyPlayed(start, end) { $.ajax({ url: '//api.paladins.guru/v2/player/recently-played-chart', data: { player: player, region: region, queue: queue, start: start, end: end }, type: "get", dataType: "json", success: function(data){ $recentlyPlayed.highcharts({ chart: { type: 'column', backgroundColor: null, spacingBottom: 5, spacingTop: 15, spacingLeft: 0, spacingRight: 0 }, title: {text: ''}, credits: {enabled: false}, xAxis: { tickWidth: 0, tickPosition: 'inside', type: "category", labels: {useHTML: true} }, yAxis: { offset: 0, title: {text: ''}, labels: {enabled: false}, minorTickInterval: 'auto', minorGridLineColor: '#f3f3f3', tickColor: '#e9e9e9', startOnTick: true, endOnTick: true, stackLabels: { enabled: true, style: { fontWeight: 'bold', color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray' }, formatter: function () { return this.total + 'T'; } } }, legend: { enabled: false }, tooltip: { headerFormat: '', pointFormat: '{series.name}: {point.y}
Total: {point.stackTotal}' }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', style: { textShadow: 'none' }, formatter: function () { if(this.y == 0) { return null; } return this.series.name == 'Wins' ? this.y + 'W' : this.y + 'L'; } } } }, series: data.results }); } }); } $(document).ready(function () { $recentlyPlayed = $('#recently-played'); changeElo($eloChart.data('start'), $eloChart.data('end')); changeRecentlyPlayed($recentlyPlayed.data('start'), $recentlyPlayed.data('end')); $('.queue-selector button').first().click(); });