The html, header and body part need to be removed, and I think we have an issue with the HTML element, it doesn’t work well when the code is not minified, we will try to improve it
You can put this version, it should works
<canvas id="myChart"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>const quadrants={id:"quadrants",beforeDraw(t,r,o){let{ctx:a,chartArea:{left:e,top:l,right:_,bottom:$},scales:{x:d,y:b}}=t,g=d.getPixelForValue(0),i=b.getPixelForValue(0);a.save(),a.fillStyle=o.topLeft,a.fillRect(e,l,g-e,i-l),a.fillStyle=o.topRight,a.fillRect(g,l,_-g,i-l),a.fillStyle=o.bottomRight,a.fillRect(g,i,_-g,$-i),a.fillStyle=o.bottomLeft,a.fillRect(e,i,g-e,$-i),a.restore()}},data={datasets:[{label:"Dataset 1",data:[{x:-67.5,y:75.44650206},{x:-67.5,y:66.41975309},{x:-75.47325103,y:52.41975309},{x:-75.47325103,y:35.39643347},{x:-83.44650206,y:47.39643347}],borderColor:"rgb(75, 192, 192)",backgroundColor:"rgba(75, 192, 192, 0.5)",pointBorderColor:"rgba(75, 192, 192, 1)",pointBorderWidth:3},{label:"Dataset 2",data:[{x:67.5,y:73.44650206},{x:67.5,y:61.41975309},{x:75.47325103,y:21.41975309},{x:75.47325103,y:37.39643347},{x:83.44650206,y:47.39643347}],borderColor:"rgb(255, 99, 132)",backgroundColor:"rgba(255, 99, 132, 0.5)",pointBorderColor:"rgba(255, 99, 132, 1)",pointBorderWidth:3},{label:"Dataset 3",data:[{x:-75.6303155,y:-44.65706447},{x:-66.6303155,y:-56.68381344},{x:-22.6303155,y:-66.68381344},{x:-42.6303155,y:-36.68381344},{x:-84.65706447,y:-46.68381344},{x:-74.65706447,y:-28.70713306}],borderColor:"rgb(54, 162, 235)",backgroundColor:"rgba(54, 162, 235, 0.5)",pointBorderColor:"rgba(54, 162, 235, 1)",pointBorderWidth:3},{label:"Dataset 4",data:[{x:25.39643347,y:-44.65706447},],borderColor:"rgb(153, 102, 255)",backgroundColor:"rgba(153, 102, 255, 0.5)",pointBorderColor:"rgba(153, 102, 255, 1)",pointBorderWidth:3},]};var ctx=document.getElementById("myChart").getContext("2d"),myChart=new Chart(ctx,{type:"scatter",data:data,options:{plugins:{quadrants:{topLeft:"rgba(255, 205, 86, 0.3)",topRight:"rgba(0, 128, 0, 0.3)",bottomRight:"rgba(255, 205, 86, 0.3)",bottomLeft:"rgba(255, 182, 193, 0.5)"},legend:{display:!1}}},plugins:[quadrants]});</script>
If you need to do it again, here the steps I followed
- I took what’s inside your body and put the script in the head aside
- I minified the javascript inside your second script with this tool => JavaScript Minifier & Compressor | Toptal®
- I removed the breakline at the start and end inside the script