Swarakalibata Ci - Grafik halaman back end pindah ke Front EndDibuat
Login Terakhir
1 Tahun lalu,
Telah Dilihat 2037 Kali
| |
Sultan Account |
|
|
Rian Irwansyah
Mengatakan :
Sultan Account
Untuk menambahkan grafik di halaman gmana ya caranya mas roby... saya udah coba copy grafik yang di admin.. tapi grafiknya ga tampil.. yg tampil head nya aja.. mohon pencerahan nya mas robby |
|
| PHPMU.COM Support commented on 15 Feb 2018 10:09:24 Sultan Account |
|
|
|
Assalam, tinggal copas script pada file grafik.php pada "application/views/administrator" kebagian
yang di inginkan pada halaman awal swarakalibata, jangan lupa file highcharts js dan css nya juga ya :
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
data: {
table: 'datatable'
},
chart: {
type: 'column'
},
title: {
text: ''
},
yAxis: {
allowDecimals: false,
title: {
text: ''
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
'Ada ' + this.point.y + ' Orang';
}
}
});
});
</script>
<div class="box box-success">
<div class="box-header">
<h3 class="box-title">Grafik Kunjungan</h3>
</div>
<div class="box-body chat" id="chat-box">
<div id="container" style="min-width: 310px; height: 340px; margin: 0 auto"></div>
<table id="datatable" style='display:none'>
<thead>
<tr>
<th></th>
<th>Jumlah Kunjungan</th>
</tr>
</thead>
<tbody>
<?php
$grafik = $this->model_app->grafik_kunjungan();
foreach ($grafik->result_array() as $row){
echo "<tr>
<th>".tgl_grafik($row['tanggal'])."</th>
<td>$row[jumlah]</td>
</tr>";
}
?>
</tbody>
</table>
</div><!-- /.chat -->
</div><!-- /.box (chat box) -->
Selesai, semoga bermanfaat..
hasilnya yang sudah kita cobakan disini bisa lihat dari prinscreen yang saya sertakan dibawah ini,.. Terdapat 1 File dilampirkan : 1. 2-15-2018_10-05-39_AM.png (515 KB) |
|
| Rian Irwansyah commented on 15 Feb 2018 11:18:13 Sultan Account |
|
|
|
udah di coba mas robby.. tetep ga tampil... highcharts js bukan nya dah langsung connect internet mas.. klo css direktorinya yg mna ya mas Terdapat 1 File dilampirkan : 1. grafik1.PNG (114 KB) |
|
| PHPMU.COM Support commented on 15 Feb 2018 15:53:56 Sultan Account |
|
|
|
Itu laptopnya konek ke internet gak mas? karena untuk sumber file js dan css untuk highchart nya harus diload dalam keadaan online / terkoneksi internet,.. <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/data.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> |
|
| Rian Irwansyah commented on 15 Feb 2018 16:09:56 Sultan Account |
|
|
|
Konek kok ke internet mas robby.. |
|
| Rian Irwansyah commented on 15 Feb 2018 16:10:46 Sultan Account |
|
|
|
tpi btw.. file css nya yang mana ya mas.. soalnya yg kliatan link nya js doank mas... |
|
| PHPMU.COM Support commented on 15 Feb 2018 19:05:41 Sultan Account |
|
|
|
gak pake css file berarti mas, file js semuanya,.. :) |
|
| Rian Irwansyah commented on 15 Feb 2018 19:08:55 Sultan Account |
|
|
|
tpi knapa ga tampil ya mas robby |
|
| PHPMU.COM Support commented on 15 Feb 2018 20:28:58 Sultan Account |
|
|
|
Sini kasih IP dan pass Teamviewer nya saja,.. saya coba cek langsung kesana,.. |
|
| Rian Irwansyah commented on 16 Feb 2018 09:12:06 Sultan Account |
|
|
|
kapan bisa di cek mas robby.. |
|
| Rian Irwansyah commented on 17 Feb 2018 11:11:09 Sultan Account |
|
|
|
Mas Robby.. grafik nya udah bisa niy.. cuma ada sedikit kendala.. file <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script> klo saya ganti ke file lokal.. <script type="text/javascript" src="assets/js/highcharts.js"></script> grafik nya ga tampil mas.. blank.. padahal direktori nya dah bener.. dan file nya ada.. mohon pencerahan nya mas robby.. |
|
| PHPMU.COM Support commented on 17 Feb 2018 11:54:12 Sultan Account |
|
|
|
Assalam, maaf baru respon lagi ,Coba perbaiki menjadi seperti ini mas : <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/highcharts.js"></script> |
|
| Rian Irwansyah commented on 17 Feb 2018 13:11:17 Sultan Account |
|
|
|
masih ga tampil mas... |
|
| PHPMU.COM Support commented on 17 Feb 2018 13:17:00 Sultan Account |
|
|
|
nama folder "assets" salah gak tu? krn jika di swarakalibata nama foldernya "asset" bukan "assets",. |
|
| Rian Irwansyah commented on 17 Feb 2018 13:58:11 Sultan Account |
|
|
|
udah dibetulin mas.. tetep ga tampil.. |
|