-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79b50f1
commit fd785bf
Showing
1 changed file
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,4 +173,108 @@ | |
</script> | ||
</body> | ||
|
||
</html> | ||
</html> | ||
|
||
<!-- <html> | ||
<head> | ||
<title>Chart</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script> | ||
<script> | ||
let analysis = JSON.parse(`<%- JSON.stringify(analysis) %>`); | ||
console.log(analysis[0].currentathelte); | ||
console.log(analysis[1].opponentdata); | ||
</script> | ||
<style> | ||
* { | ||
font-size: 30px !important; | ||
background-color: white; | ||
} | ||
.col-6 { | ||
margin: 0; | ||
} | ||
</style> | ||
</head> | ||
<body class="bg-white"> | ||
<div class="container mx-auto my-8 text-center"> | ||
<h1 class="text-4xl font-bold my-4">Combined Analysis</h1> | ||
<div id="combinedMarks" class="chart-container mx-auto border border-black rounded-sm shadow-sm shadow-black "> | ||
</div> | ||
</div> | ||
<script> | ||
function combinedMarks() { | ||
let athleteData = []; | ||
let opponentData = []; | ||
for (const key in analysis[0].currentathelte) { | ||
athleteData.push(analysis[0].currentathelte[key]); | ||
} | ||
for (const key in analysis[1].opponentdata) { | ||
opponentData.push(analysis[1].opponentdata[key]); | ||
} | ||
var options = { | ||
series: [{ | ||
name: 'Your Athlete', | ||
data: athleteData, | ||
}, { | ||
name: 'Opponent', | ||
data: opponentData, | ||
}], | ||
chart: { | ||
type: 'radar', | ||
height: "60%", | ||
width: "100%", | ||
}, | ||
dataLabels: { | ||
enabled: false, | ||
}, | ||
plotOptions: { | ||
radar: { | ||
polygontype: 'smooth', | ||
polygons: { | ||
strokeColors: '#fff', | ||
fill: { | ||
colors: ['#000', '#FF4560'], | ||
} | ||
} | ||
} | ||
}, | ||
colors: ['orange', 'white'], | ||
markers: { | ||
size: 6, | ||
colors: ['#fff'], | ||
strokeColor: ['#fff', '#FF4560'], | ||
strokeWidth: 2, | ||
}, | ||
xaxis: { | ||
categories: Object.keys(analysis[0].currentathelte), | ||
labels: { | ||
style: { | ||
colors: '#000', | ||
} | ||
} | ||
}, | ||
yaxis: { | ||
show: false | ||
} | ||
}; | ||
var chart = new ApexCharts(document.querySelector("#combinedMarks"), options); | ||
chart.render(); | ||
} | ||
combinedMarks(); | ||
</script> | ||
</body> | ||
</html> --> |