js.blade.php 3.5 KB

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