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.

crm-dashboard.js 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. 'use strict';
  2. $(document).ready(function() {
  3. // task and revenue start
  4. var chart = AmCharts.makeChart("revenue-map", {
  5. "type": "serial",
  6. "theme": "light",
  7. "dataDateFormat": "YYYY-MM-DD",
  8. "precision": 2,
  9. "valueAxes": [{
  10. "id": "v1",
  11. "title": "Sales",
  12. "position": "left",
  13. "autoGridCount": false,
  14. "labelFunction": function(value) {
  15. return "$" + Math.round(value) + "M";
  16. }
  17. }, {
  18. "id": "v2",
  19. "title": "Revenue Market",
  20. "gridAlpha": 0,
  21. "autoGridCount": false
  22. }],
  23. "graphs": [{
  24. "id": "g1",
  25. "valueAxis": "v2",
  26. "bullet": "round",
  27. "bulletBorderAlpha": 1,
  28. "bulletColor": "#FFFFFF",
  29. "bulletSize": 5,
  30. "hideBulletsCount": 50,
  31. "lineThickness": 2,
  32. "lineColor": "#448aff",
  33. "type": "smoothedLine",
  34. "title": "Market Days",
  35. "useLineColorForBulletBorder": true,
  36. "valueField": "market1",
  37. "balloonText": "[[title]]<br /><b style='font-size: 130%'>[[value]]</b>"
  38. }, {
  39. "id": "g2",
  40. "valueAxis": "v2",
  41. "bullet": "round",
  42. "bulletBorderAlpha": 1,
  43. "bulletColor": "#FFFFFF",
  44. "bulletSize": 5,
  45. "hideBulletsCount": 50,
  46. "lineThickness": 2,
  47. "lineColor": "#536dfe",
  48. "type": "smoothedLine",
  49. "title": "Market Days ALL",
  50. "useLineColorForBulletBorder": true,
  51. "valueField": "market2",
  52. "balloonText": "[[title]]<br /><b style='font-size: 130%'>[[value]]</b>"
  53. }],
  54. "chartCursor": {
  55. "pan": true,
  56. "valueLineEnabled": true,
  57. "valueLineBalloonEnabled": true,
  58. "cursorAlpha": 0,
  59. "valueLineAlpha": 0.2
  60. },
  61. "categoryField": "date",
  62. "categoryAxis": {
  63. "parseDates": true,
  64. "dashLength": 1,
  65. "minorGridEnabled": true
  66. },
  67. "legend": {
  68. "useGraphSettings": true,
  69. "position": "top"
  70. },
  71. "balloon": {
  72. "borderThickness": 1,
  73. "shadowAlpha": 0
  74. },
  75. "export": {
  76. "enabled": true
  77. },
  78. "dataProvider": [{
  79. "date": "2013-01-16",
  80. "market1": 85,
  81. "market2": 75
  82. }, {
  83. "date": "2013-01-17",
  84. "market1": 74,
  85. "market2": 80
  86. }, {
  87. "date": "2013-01-18",
  88. "market1": 78,
  89. "market2": 88
  90. }, {
  91. "date": "2013-01-19",
  92. "market1": 85,
  93. "market2": 75
  94. }, {
  95. "date": "2013-01-20",
  96. "market1": 82,
  97. "market2": 89
  98. }, {
  99. "date": "2013-01-21",
  100. "market1": 83,
  101. "market2": 78
  102. }, {
  103. "date": "2013-01-22",
  104. "market1": 72,
  105. "market2": 92
  106. }, {
  107. "date": "2013-01-23",
  108. "market1": 85,
  109. "market2": 76
  110. }]
  111. });
  112. // task and revenue end
  113. /*markers map*/
  114. var map;
  115. map = new GMaps({
  116. el: '#markers-map',
  117. lat: 21.2334329,
  118. lng: 72.866472,
  119. scrollwheel: false
  120. });
  121. map.addMarker({
  122. lat: 21.2334329,
  123. lng: 72.866472,
  124. title: 'Marker with InfoWindow',
  125. infoWindow: {
  126. content: '<p><Phoenicoded></Phoenicoded> <br/> Buy Now at <a href="">Themeforest</a></p>'
  127. }
  128. });
  129. // income start
  130. var ctx = document.getElementById('tot-lead').getContext("2d");
  131. var myChart = new Chart(ctx, {
  132. type: 'line',
  133. data: valincomearrow('#536dfe', [30, 15, 25, 35, 30, 20, 15, 20, 25,40, 25, 30, 22, 31], '#536dfe'),
  134. options: valincomebuildoption(),
  135. });
  136. var ctx = document.getElementById('tot-vendor').getContext("2d");
  137. var myChart = new Chart(ctx, {
  138. type: 'line',
  139. data: valincomearrow('#11c15b', [40, 25, 30, 22,30, 15, 25, 35, 30, 20, 15, 20, 25, 31], '#11c15b'),
  140. options: valincomebuildoption(),
  141. });
  142. var ctx = document.getElementById('invoice-gen').getContext("2d");
  143. var myChart = new Chart(ctx, {
  144. type: 'line',
  145. data: valincomearrow('#448aff', [25, 30,20, 15, 20, 25, 31, 22,30, 15, 25, 35, 30,40], '#448aff'),
  146. options: valincomebuildoption(),
  147. });
  148. function valincomearrow(a, b, f) {
  149. if (f == null) {
  150. f = "rgba(0,0,0,0)";
  151. }
  152. return {
  153. labels: ["1","2","3","4","5","6","7","8","9","10","11","12","13","14"],
  154. datasets: [{
  155. label: "",
  156. borderColor: a,
  157. borderWidth: 3,
  158. hitRadius: 30,
  159. pointRadius: 0,
  160. pointHoverRadius: 4,
  161. pointBorderWidth: 2,
  162. pointHoverBorderWidth: 12,
  163. pointBackgroundColor: Chart.helpers.color("#000000").alpha(0).rgbString(),
  164. pointBorderColor: a,
  165. pointHoverBackgroundColor: a,
  166. pointHoverBorderColor: Chart.helpers.color("#000000").alpha(.1).rgbString(),
  167. fill: true,
  168. lineTension:0,
  169. backgroundColor: Chart.helpers.color(f).alpha(.7).rgbString(),
  170. data: b,
  171. }]
  172. };
  173. }
  174. function valincomebuildoption() {
  175. return {
  176. title: {
  177. display: false,
  178. },
  179. tooltips: {
  180. intersect: false,
  181. mode: 'nearest',
  182. xPadding: 10,
  183. yPadding: 10,
  184. caretPadding: 10
  185. },
  186. legend: {
  187. display: false
  188. },
  189. hover: {
  190. mode: 'index'
  191. },
  192. scales: {
  193. xAxes: [{
  194. display: false,
  195. gridLines: false,
  196. scaleLabel: {
  197. display: true,
  198. labelString: 'Month'
  199. }
  200. }],
  201. yAxes: [{
  202. display: false,
  203. gridLines: false,
  204. scaleLabel: {
  205. display: true,
  206. labelString: 'Value'
  207. },
  208. ticks: {
  209. min: 1,
  210. max: 50
  211. }
  212. }]
  213. },
  214. elements: {
  215. point: {
  216. radius: 4,
  217. borderWidth: 12
  218. }
  219. },
  220. layout: {
  221. padding: {
  222. left: 0,
  223. right: 0,
  224. top: 0,
  225. bottom: 0
  226. }
  227. }
  228. };
  229. }
  230. // income end
  231. });