SHOW:
|
|
- or go back to the newest paste.
| 1 | //di models | |
| 2 | function data() | |
| 3 | {
| |
| 4 | $test = $this->db->query("select * from tbl_test");
| |
| 5 | $data1=array(); | |
| 6 | foreach($test->result_array()as $row) | |
| 7 | {
| |
| 8 | - | $this->session->set_userdata($data1); |
| 8 | + | |
| 9 | - | |
| 9 | + | |
| 10 | //$this->session->set_userdata($data1); | |
| 11 | return $data1; | |
| 12 | } | |
| 13 | //di view | |
| 14 | <script type="text/javascript"> | |
| 15 | jQuery(function(){
| |
| 16 | new Highcharts.Chart({
| |
| 17 | chart: {
| |
| 18 | renderTo: 'chart', | |
| 19 | type: 'line', | |
| 20 | }, | |
| 21 | title: {
| |
| 22 | text: 'Pendapatan Hotel Tahun 2014', | |
| 23 | x: -20 | |
| 24 | }, | |
| 25 | subtitle: {
| |
| 26 | text: 'www.hotel-dymens.com', | |
| 27 | x: -20 | |
| 28 | }, | |
| 29 | xAxis: {
| |
| 30 | categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | |
| 31 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | |
| 32 | }, | |
| 33 | yAxis: {
| |
| 34 | title: {
| |
| 35 | text: 'Pendapatan (Juta)' | |
| 36 | } | |
| 37 | - | data: <?php echo json_encode($this->session->userdata('hasil')); ?> //menampilkan data
|
| 37 | + | |
| 38 | series: [{
| |
| 39 | name: 'Pendapatan (Juta)', | |
| 40 | data: <?php echo json_encode($this->my_model->data() ); ?> //menampilkan data | |
| 41 | }] | |
| 42 | }); | |
| 43 | }); | |
| 44 | </script> |