I watched some videos but I still don’t understand it properly. I asked the gpt chat to make me a code for this graph, but I can’t insert it into the web.
document.addEventListener(‘DOMContentLoaded’, function () {
const ctx = document.getElementById(‘myRadarChart’).getContext(‘2d’);
const myRadarChart = new Chart(ctx, {
type: ‘radar’,
data: {
labels: [‘Social Policy’, ‘Government Spending’, ‘Environmental’, ‘Internal Issues’],
datasets: [{
label: ‘Policy Preferences’,
data: [80, 60, 70, 90],
backgroundColor: ‘rgba(75, 192, 192, 0.2)’,
borderColor: ‘rgba(75, 192, 192, 1)’,
borderWidth: 2,
pointBackgroundColor: ‘rgba(255, 99, 132, 1)’,
pointBorderColor: ‘#fff’,
pointHoverBackgroundColor: ‘#fff’,
pointHoverBorderColor: ‘rgba(255, 99, 132, 1)’
}]
},
options: {
scales: {
r: {
angleLines: {
display: true
},
suggestedMin: 50,
suggestedMax: 100
}
}
}
});
});