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.

knob-custom-chart.js 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. "use strict";
  2. $(window).on('resize',function() {
  3. $(".dial").knob({
  4. draw: function() {
  5. // "tron" case
  6. if (this.$.data('skin') == 'tron') {
  7. this.cursorExt = 0.3;
  8. var a = this.arc(this.cv) // Arc
  9. ,
  10. pa // Previous arc
  11. , r = 1;
  12. this.g.lineWidth = this.lineWidth;
  13. if (this.o.displayPrevious) {
  14. pa = this.arc(this.v);
  15. this.g.beginPath();
  16. this.g.strokeStyle = this.pColor;
  17. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
  18. this.g.stroke();
  19. }
  20. this.g.beginPath();
  21. this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
  22. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
  23. this.g.stroke();
  24. this.g.lineWidth = 2;
  25. this.g.beginPath();
  26. this.g.strokeStyle = this.o.fgColor;
  27. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
  28. this.g.stroke();
  29. return false;
  30. }
  31. }
  32. });
  33. });
  34. $(document).ready(function() {
  35. /*× Overloaded 'draw' method*/
  36. $(".dial").knob({
  37. draw: function() {
  38. // "tron" case
  39. if (this.$.data('skin') == 'tron') {
  40. this.cursorExt = 0.3;
  41. var a = this.arc(this.cv) // Arc
  42. ,
  43. pa // Previous arc
  44. , r = 1;
  45. this.g.lineWidth = this.lineWidth;
  46. if (this.o.displayPrevious) {
  47. pa = this.arc(this.v);
  48. this.g.beginPath();
  49. this.g.strokeStyle = this.pColor;
  50. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
  51. this.g.stroke();
  52. }
  53. this.g.beginPath();
  54. this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
  55. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
  56. this.g.stroke();
  57. this.g.lineWidth = 2;
  58. this.g.beginPath();
  59. this.g.strokeStyle = this.o.fgColor;
  60. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
  61. this.g.stroke();
  62. return false;
  63. }
  64. }
  65. });
  66. });