Skip to content

Commit

Permalink
comparative analysis in both way
Browse files Browse the repository at this point in the history
  • Loading branch information
devamdoshi212 committed Nov 22, 2023
1 parent 79b50f1 commit fd785bf
Showing 1 changed file with 105 additions and 1 deletion.
106 changes: 105 additions & 1 deletion views/comparativechart.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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> -->

0 comments on commit fd785bf

Please sign in to comment.