js.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <script src="http://code.highcharts.com/highcharts.js"></script>
  2. <script src="http://code.highcharts.com/maps/modules/map.js"></script>
  3. <script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
  4. <script src="http://code.highcharts.com/mapdata/countries/us/us-all.js"></script>
  5. <script>
  6. Highcharts.chart('chart1', {
  7. chart: {
  8. type: 'bar'
  9. },
  10. xAxis: {
  11. categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
  12. title: {
  13. text: null
  14. }
  15. },
  16. yAxis: {
  17. min: 0,
  18. title: {
  19. text: 'Population (millions)',
  20. align: 'high'
  21. },
  22. labels: {
  23. overflow: 'justify'
  24. }
  25. },
  26. tooltip: {
  27. valueSuffix: ' millions'
  28. },
  29. plotOptions: {
  30. bar: {
  31. dataLabels: {
  32. enabled: true
  33. }
  34. }
  35. },
  36. legend: {
  37. layout: 'vertical',
  38. align: 'right',
  39. verticalAlign: 'top',
  40. x: -40,
  41. y: 80,
  42. floating: true,
  43. borderWidth: 1,
  44. backgroundColor:
  45. Highcharts.defaultOptions.legend.backgroundColor || '#000',
  46. shadow: true
  47. },
  48. credits: {
  49. enabled: false
  50. },
  51. series: [{
  52. name: 'Year 1800',
  53. data: [107, 31, 635, 203, 2]
  54. }]
  55. });
  56. </script>
  57. <script>
  58. Highcharts.chart('chart2', {
  59. chart: {
  60. plotBackgroundColor: null,
  61. plotBorderWidth: null,
  62. plotShadow: false,
  63. type: 'pie'
  64. },
  65. title:false,
  66. tooltip: {
  67. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  68. },
  69. plotOptions: {
  70. pie: {
  71. size:'70%',
  72. allowPointSelect: true,
  73. cursor: 'pointer',
  74. dataLabels: {
  75. enabled: true,
  76. format: '<b>{point.name}</b>: {point.percentage:.1f} %'
  77. }
  78. }
  79. },
  80. series: [{
  81. name: 'Brands',
  82. colorByPoint: true,
  83. data: [{
  84. name: 'Chrome',
  85. y: 61.41,
  86. sliced: true,
  87. selected: true
  88. }, {
  89. name: 'Internet Explorer',
  90. y: 11.84
  91. }, {
  92. name: 'Firefox',
  93. y: 10.85
  94. }, {
  95. name: 'Edge',
  96. y: 4.67
  97. }, {
  98. name: 'Safari',
  99. y: 4.18
  100. }, {
  101. name: 'Sogou Explorer',
  102. y: 1.64
  103. }, {
  104. name: 'Opera',
  105. y: 1.6
  106. }, {
  107. name: 'QQ',
  108. y: 1.2
  109. }, {
  110. name: 'Other',
  111. y: 2.61
  112. }]
  113. }]
  114. });
  115. </script>
  116. <script>
  117. Highcharts.chart('chart3', {
  118. chart: {
  119. type: 'bar'
  120. },
  121. title:false,
  122. xAxis: {
  123. categories: ['Aceh', 'Lampung', 'Jakarta', 'Bandung', 'Bali'],
  124. title: {
  125. text: null
  126. }
  127. },
  128. yAxis: {
  129. min: 0,
  130. title: {
  131. text: 'UPT',
  132. align: 'high'
  133. },
  134. labels: {
  135. overflow: 'justify'
  136. }
  137. },
  138. tooltip: {
  139. valueSuffix: ' Jumlah'
  140. },
  141. plotOptions: {
  142. bar: {
  143. dataLabels: {
  144. enabled: true
  145. }
  146. }
  147. },
  148. legend: {
  149. layout: 'vertical',
  150. align: 'right',
  151. verticalAlign: 'top',
  152. x: -40,
  153. y: 80,
  154. floating: true,
  155. borderWidth: 1,
  156. backgroundColor:
  157. Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
  158. shadow: true
  159. },
  160. credits: {
  161. enabled: false
  162. },
  163. series: [{
  164. name: 'Tahun 2017',
  165. data: [107, 31, 635, 203, 2]
  166. }, {
  167. name: 'Tahun 2018',
  168. data: [133, 156, 947, 408, 6]
  169. }, {
  170. name: 'Tahun 2019',
  171. data: [814, 841, 3714, 727, 31]
  172. }, {
  173. name: 'Tahun 2020',
  174. data: [1216, 1001, 4436, 738, 40]
  175. }]
  176. });
  177. </script>
  178. <script>
  179. Highcharts.chart('bahansosialisasi-operator', {
  180. chart: {
  181. plotBackgroundColor: null,
  182. plotBorderWidth: null,
  183. plotShadow: false,
  184. type: 'pie'
  185. },
  186. title:false,
  187. tooltip: {
  188. pointFormat: '{series.name}: <b>{point.y}</b>'
  189. },
  190. plotOptions: {
  191. pie: {
  192. size:'70%',
  193. allowPointSelect: true,
  194. cursor: 'pointer',
  195. dataLabels: {
  196. enabled: true,
  197. format: '<b>{point.name}</b>: {point.y}'
  198. }
  199. }
  200. },
  201. <?php
  202. $materi = \App\Model\Refrension\Materi::all();
  203. ?>
  204. series: [{
  205. name: 'Brands',
  206. colorByPoint: true,
  207. data: [
  208. @foreach($materi as $key => $value)
  209. {
  210. name: '{{$value->jenis_materi}}',
  211. y: {{\App\Model\SosialisasiBimtek\BahanSosialisasi::where('id_materi',$value->id)->where('kode_upt',Auth::user()->id_upt)->count()}}
  212. },
  213. @endforeach
  214. ]
  215. }]
  216. });
  217. </script>
  218. <script>
  219. Highcharts.chart('bahansosialisasi-admin', {
  220. chart: {
  221. plotBackgroundColor: null,
  222. plotBorderWidth: null,
  223. plotShadow: false,
  224. type: 'pie'
  225. },
  226. title:false,
  227. tooltip: {
  228. pointFormat: '{series.name}: <b>{point.y}</b>'
  229. },
  230. plotOptions: {
  231. pie: {
  232. size:'70%',
  233. allowPointSelect: true,
  234. cursor: 'pointer',
  235. dataLabels: {
  236. enabled: true,
  237. format: '<b>{point.name}</b>: {point.y}'
  238. }
  239. }
  240. },
  241. <?php
  242. $materi = \App\Model\Refrension\Materi::all();
  243. ?>
  244. series: [{
  245. name: 'Brands',
  246. colorByPoint: true,
  247. data: [
  248. @foreach($materi as $key => $value)
  249. {
  250. name: '{{$value->materi}}',
  251. y: {{\App\Model\SosialisasiBimtek\BahanSosialisasi::where('id_materi',$value->id)->count()}}
  252. },
  253. @endforeach
  254. ]
  255. }]
  256. });
  257. </script>
  258. <script>
  259. Highcharts.chart('bahansosialisasi-admin2', {
  260. chart: {
  261. type: 'bar'
  262. },
  263. title:false,
  264. <?php
  265. $upt = \App\Model\Setting\UPT::distinct('office_id')->get();
  266. ?>
  267. xAxis: {
  268. categories: [
  269. @foreach($upt as $key => $value)
  270. '{{$value->office_name}}',
  271. @endforeach
  272. ],
  273. title: {
  274. text: null
  275. }
  276. },
  277. yAxis: {
  278. min: 0,
  279. title: {
  280. text: 'UPT',
  281. align: 'high'
  282. },
  283. labels: {
  284. overflow: 'justify'
  285. }
  286. },
  287. tooltip: {
  288. valueSuffix: ' Jumlah'
  289. },
  290. plotOptions: {
  291. bar: {
  292. dataLabels: {
  293. enabled: true
  294. }
  295. }
  296. },
  297. legend: {
  298. layout: 'vertical',
  299. align: 'right',
  300. verticalAlign: 'top',
  301. x: -40,
  302. y: 80,
  303. floating: true,
  304. borderWidth: 1,
  305. backgroundColor:
  306. Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
  307. shadow: true
  308. },
  309. credits: {
  310. enabled: false
  311. },
  312. series: [
  313. {
  314. name: 'Teraslisasi',
  315. data: [
  316. @foreach($upt as $key => $value)
  317. {{\App\Model\SosialisasiBimtek\BahanSosialisasi::where('status',0)->where('kode_upt',$value->office_id)->count()}},
  318. @endforeach
  319. ]
  320. }, {
  321. name: 'Belum Teraslisasi',
  322. data: [
  323. @foreach($upt as $key => $value)
  324. {{\App\Model\SosialisasiBimtek\BahanSosialisasi::where('status',1)->where('kode_upt',$value->office_id)->count()}},
  325. @endforeach
  326. ]
  327. },
  328. ]
  329. });
  330. </script>
  331. <script type="text/javascript">
  332. var map = am4core.create("chartdiv", am4maps.MapChart);
  333. </script>