peity.js 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // peity
  2. $(function () {
  3. 'use strict';
  4. // pie chart
  5. $("span.pie").peity("pie");
  6. // line chart
  7. $("span.line1").peity("line", {
  8. fill: ["#f3f5f6"],
  9. stroke: ["#0bb2d4"],
  10. height: 32,
  11. width: 120,
  12. });
  13. $("span.line2").peity("line", {
  14. fill: ["#17b3a3"],
  15. stroke: ["#17b3a3"],
  16. height: 64,
  17. width: 250,
  18. });
  19. $("span.line3").peity("line", {
  20. fill: ["transparent"],
  21. stroke: ["#ff4c52"],
  22. height: 96,
  23. width: 250,
  24. });
  25. // donut chart
  26. $('.donut').peity('donut');
  27. // bar chart
  28. $(".bar").peity("bar");
  29. // updatingChart chart
  30. var updatingChart = $(".updating-chart").peity("line", {
  31. height: 96,
  32. width: 250,
  33. fill: ["#eeeeee"],
  34. stroke: ["#17b3a3"],
  35. });
  36. setInterval(function() {
  37. var random = Math.round(Math.random() * 10);
  38. var values = updatingChart.text().split(",");
  39. values.shift();
  40. values.push(random);
  41. updatingChart
  42. .text(values.join(","))
  43. .change();
  44. }, 1000);
  45. });// End of use strict