js.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. @include('dev.helpers.jquery')
  2. <script src="http://code.highcharts.com/highcharts.js"></script>
  3. <script src="http://code.highcharts.com/maps/modules/map.js"></script>
  4. <script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
  5. <script src="http://code.highcharts.com/mapdata/countries/us/us-all.js"></script>
  6. <script>
  7. Highcharts.chart('rencanasosialisasi-operator', {
  8. chart: {
  9. plotBackgroundColor: null,
  10. plotBorderWidth: null,
  11. plotShadow: false,
  12. type: 'pie'
  13. },
  14. title:false,
  15. tooltip: {
  16. pointFormat: '{series.name}: <b>{point.y}</b>'
  17. },
  18. plotOptions: {
  19. pie: {
  20. size:'70%',
  21. allowPointSelect: true,
  22. cursor: 'pointer',
  23. dataLabels: {
  24. enabled: true,
  25. format: '<b>{point.name}</b>: {point.y}'
  26. }
  27. }
  28. },
  29. <?php
  30. $kegiatan = \App\Model\Refrension\Kegiatan::all();
  31. ?>
  32. series: [{
  33. name: 'Brands',
  34. colorByPoint: true,
  35. data: [
  36. @foreach($kegiatan as $key => $value)
  37. {
  38. name: '{{$value->kegiatan}}',
  39. y: {{\App\Model\SosialisasiBimtek\RencanaSosialisasi::where('jenis_kegiatan',$value->id)->where('kode_upt',Auth::user()->upt)->count()}}
  40. },
  41. @endforeach
  42. ]
  43. }]
  44. });
  45. </script>
  46. <script>
  47. Highcharts.chart('rencanasosialisasi-admin', {
  48. chart: {
  49. plotBackgroundColor: null,
  50. plotBorderWidth: null,
  51. plotShadow: false,
  52. type: 'pie'
  53. },
  54. title:false,
  55. tooltip: {
  56. pointFormat: '{series.name}: <b>{point.y}</b>'
  57. },
  58. plotOptions: {
  59. pie: {
  60. size:'70%',
  61. allowPointSelect: true,
  62. cursor: 'pointer',
  63. dataLabels: {
  64. enabled: true,
  65. format: '<b>{point.name}</b>: {point.y}'
  66. }
  67. }
  68. },
  69. <?php
  70. $kegiatan = \App\Model\Refrension\Kegiatan::all();
  71. ?>
  72. series: [{
  73. name: 'Brands',
  74. colorByPoint: true,
  75. data: [
  76. @foreach($kegiatan as $key => $value)
  77. {
  78. name: '{{$value->kegiatan}}',
  79. y: {{\App\Model\SosialisasiBimtek\RencanaSosialisasi::where('jenis_kegiatan',$value->id)->count()}}
  80. },
  81. @endforeach
  82. ]
  83. }]
  84. });
  85. </script>
  86. <script>
  87. Highcharts.chart('rencanasosialisasi-admin2', {
  88. chart: {
  89. type: 'bar'
  90. },
  91. title:false,
  92. <?php
  93. $upt = \App\Model\Setting\UPT::select('office_name','office_id')->distinct()->get();
  94. ?>
  95. xAxis: {
  96. categories: [
  97. @foreach($upt as $key => $value)
  98. '{{$value->office_name}}',
  99. @endforeach
  100. ],
  101. title: {
  102. text: null
  103. }
  104. },
  105. yAxis: {
  106. min: 0,
  107. title: {
  108. text: 'UPT',
  109. align: 'high'
  110. },
  111. labels: {
  112. overflow: 'justify'
  113. }
  114. },
  115. tooltip: {
  116. valueSuffix: ' Jumlah'
  117. },
  118. plotOptions: {
  119. bar: {
  120. dataLabels: {
  121. enabled: true
  122. }
  123. }
  124. },
  125. legend: {
  126. layout: 'vertical',
  127. align: 'right',
  128. verticalAlign: 'top',
  129. x: -40,
  130. y: 80,
  131. floating: true,
  132. borderWidth: 1,
  133. backgroundColor:
  134. Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
  135. shadow: true
  136. },
  137. credits: {
  138. enabled: false
  139. },
  140. series: [
  141. {
  142. name: 'Teraslisasi',
  143. data: [
  144. @foreach($upt as $key => $value)
  145. {{\App\Model\SosialisasiBimtek\MonevSosialisasi::whereNotNull('id_rensos')->where('kode_upt',$value->office_id)->count()}},
  146. @endforeach
  147. ]
  148. }, {
  149. name: 'Belum Teraslisasi',
  150. data: [
  151. @foreach($upt as $key => $value)
  152. <?php
  153. $terealisasi = \App\Model\SosialisasiBimtek\MonevSosialisasi::whereNotNull('id_rensos')->where('kode_upt',$value->office_id)->count();
  154. $blm = \App\Model\SosialisasiBimtek\RencanaSosialisasi::where('kode_upt',$value->office_id)->count();
  155. $total = $blm - $terealisasi;
  156. ?>
  157. {{$total}},
  158. @endforeach
  159. ]
  160. },
  161. ]
  162. });
  163. </script>
  164. <script type="text/javascript">
  165. var map = am4core.create("chartdiv", am4maps.MapChart);
  166. </script>
  167. <script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>