radar.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Radar Chart</title>
  5. <script src="../Chart.js"></script>
  6. <meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
  7. <style>
  8. canvas{
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <div style="width:30%">
  14. <canvas id="canvas" height="450" width="450"></canvas>
  15. </div>
  16. <script>
  17. var radarChartData = {
  18. labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
  19. datasets: [
  20. {
  21. label: "My First dataset",
  22. fillColor: "rgba(220,220,220,0.2)",
  23. strokeColor: "rgba(220,220,220,1)",
  24. pointColor: "rgba(220,220,220,1)",
  25. pointStrokeColor: "#fff",
  26. pointHighlightFill: "#fff",
  27. pointHighlightStroke: "rgba(220,220,220,1)",
  28. data: [65,59,90,81,56,55,40]
  29. },
  30. {
  31. label: "My Second dataset",
  32. fillColor: "rgba(151,187,205,0.2)",
  33. strokeColor: "rgba(151,187,205,1)",
  34. pointColor: "rgba(151,187,205,1)",
  35. pointStrokeColor: "#fff",
  36. pointHighlightFill: "#fff",
  37. pointHighlightStroke: "rgba(151,187,205,1)",
  38. data: [28,48,40,19,96,27,100]
  39. }
  40. ]
  41. };
  42. window.onload = function(){
  43. window.myRadar = new Chart(document.getElementById("canvas").getContext("2d")).Radar(radarChartData, {
  44. responsive: true
  45. });
  46. }
  47. </script>
  48. </body>
  49. </html>