[Chartjs]-I can't add data to chartjs from codeigniter

1πŸ‘

// This Is edited Code for encode json for $info[β€˜data’]

public function chartjs(){
        $info['title'] = 'Chartjs';
        $post_data = $this->post_model->get_posts();
        $info['data'] = json_encode($post_data);
        $this->load->view('templates/header');
        $this->load->view('chartjs',$info);
        $this->load->view('templates/footer');
    }

I am sure help of this code You can encode json correctly.
Thanks,
Kamiyab ali

Leave a comment