Dashboard sipadu mbip
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.

peity-custom-chart.js 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. "use strict";
  2. $(document).ready(function() {
  3. setTimeout(function(){
  4. $(window).resize(function() {
  5. barChart();
  6. updatingChart();
  7. dataChart();
  8. });
  9. barChart();
  10. updatingChart();
  11. dataChart();
  12. },350);
  13. /* bar chart */
  14. function barChart() {
  15. $(".bar-colours-1").peity("bar", {
  16. fill: ["rgba(68, 138, 255, 0.65)", "rgba(255, 82, 82, 0.65)"]
  17. });
  18. $(".bar-colours-2").peity("bar", {
  19. fill: ["rgba(83, 109, 254, 0.65)", "rgba(17, 193, 91, 0.65)"]
  20. });
  21. }
  22. function updatingChart() {
  23. /*updating chart*/
  24. var updatingChart = $(".updating-chart").peity("line", { fill: "rgba(0, 188, 212, 0.4)", stroke: "rgb(0, 188, 212)" });
  25. var updatingChart1 = $(".updating-chart1").peity("line", { fill: "rgba(17, 193, 91, 0.32)", stroke: "rgba(17, 193, 91, 0.90)" });
  26. var updatingChart2 = $(".updating-chart2").peity("line", { fill: "rgba(68, 138, 255, 0.45)", stroke: "rgba(68, 138, 255, 0.91)" });
  27. var updatingChart3 = $(".updating-chart3").peity("line", { fill: "rgba(83, 109, 254, 0.39)", stroke: "rgba(83, 109, 254, 0.94)" });
  28. setInterval(function() {
  29. var random = Math.round(Math.random() * 10)
  30. var values = updatingChart.text().split(",")
  31. values.shift()
  32. values.push(random)
  33. updatingChart
  34. .text(values.join(","))
  35. .change()
  36. }, 1000);
  37. }
  38. function dataChart() {
  39. /*DATA-ATTRIBUTES CHARTS */
  40. $(".data-attributes span").peity("donut");
  41. /*Pie Charts*/
  42. $("span.pie_1").peity("pie", {
  43. fill: ["#ffe100", "#282256"]
  44. });
  45. $("span.pie_2").peity("pie", {
  46. fill: ["#ff5252", "#2980B9"]
  47. });
  48. $("span.pie_3").peity("pie", {
  49. fill: ["#785EDD", "#F6CD61"]
  50. });
  51. $("span.pie_4").peity("pie", {
  52. fill: ["#EB9532", "#0F3057"]
  53. });
  54. $("span.pie_5").peity("pie", {
  55. fill: ["#64DDBB", "#42729B"]
  56. });
  57. $("span.pie_6").peity("pie", {
  58. fill: ["#97CE68", "#60646D"]
  59. });
  60. $("span.pie_7").peity("pie", {
  61. fill: ["#00B5B5", "#517FA4"]
  62. });
  63. }
  64. });