circle.html 696 B

123456789101112131415161718192021222324
  1. <html>
  2. <body>
  3. <div class="circleChart" id="0"></div>
  4. <div class="circleChart" id="1" data-value="77"></div>
  5. <script src="../jquery-3.4.1/jquery-3.4.1.min.js"></script>
  6. <script src="circleChart.min.js"></script>
  7. <script>
  8. $(".circleChart#1").circleChart();
  9. $(".circleChart#0").circleChart({
  10. size: 500,
  11. value: 50,
  12. text: 0,
  13. onDraw: function(el, circle) {
  14. circle.text(Math.round(circle.value) + "%");
  15. }
  16. });
  17. setInterval(function() {
  18. $("#0").circleChart({
  19. value: Math.random() * 100
  20. });
  21. }, 4000);
  22. </script>
  23. </body>
  24. </html>