You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.2 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. "use strict";
  2. $(document).ready(function() {
  3. $(window).resize(function() {
  4. barChart();
  5. updatingChart();
  6. dataChart();
  7. });
  8. barChart();
  9. updatingChart();
  10. dataChart();
  11. /* bar chart */
  12. function barChart() {
  13. $(".bar-colours-1").peity("bar", {
  14. fill: ["rgba(93, 156, 236, 0.65)", "rgba(153, 214, 131, 0.87)"]
  15. });
  16. $(".bar-colours-2").peity("bar", {
  17. fill: ["rgba(44, 201, 144, 0.52)", "rgba(44, 130, 201, 0.60)"]
  18. });
  19. }
  20. function updatingChart() {
  21. /*updating chart*/
  22. var updatingChart = $(".updating-chart").peity("line", { fill: "rgba(140, 239, 243, 0.4)", stroke: "rgb(140, 239, 243)" });
  23. var updatingChart1 = $(".updating-chart1").peity("line", { fill: "rgba(95, 190, 170, 0.32)", stroke: "rgba(95, 190, 170, 0.90)" });
  24. var updatingChart2 = $(".updating-chart2").peity("line", { fill: "rgba(93, 156, 236, 0.45)", stroke: "rgba(93, 156, 236, 0.91)" });
  25. var updatingChart3 = $(".updating-chart3").peity("line", { fill: "rgba(178, 180, 253, 0.39)", stroke: "rgba(178, 180, 253, 0.94)" });
  26. setInterval(function() {
  27. var random = Math.round(Math.random() * 10)
  28. var values = updatingChart.text().split(",")
  29. values.shift()
  30. values.push(random)
  31. updatingChart
  32. .text(values.join(","))
  33. .change()
  34. }, 1000);
  35. }
  36. function dataChart() {
  37. /*DATA-ATTRIBUTES CHARTS */
  38. $(".data-attributes span").peity("donut");
  39. /*Pie Charts*/
  40. $("span.pie_1").peity("pie", {
  41. fill: ["#F1C40F", "#282256"]
  42. });
  43. $("span.pie_2").peity("pie", {
  44. fill: ["#FC575E", "#2980B9"]
  45. });
  46. $("span.pie_3").peity("pie", {
  47. fill: ["#785EDD", "#F6CD61"]
  48. });
  49. $("span.pie_4").peity("pie", {
  50. fill: ["#EB9532", "#0F3057"]
  51. });
  52. $("span.pie_5").peity("pie", {
  53. fill: ["#64DDBB", "#42729B"]
  54. });
  55. $("span.pie_6").peity("pie", {
  56. fill: ["#97CE68", "#60646D"]
  57. });
  58. $("span.pie_7").peity("pie", {
  59. fill: ["#00B5B5", "#517FA4"]
  60. });
  61. }
  62. });