如何使用codeigniter向我的图表显示5个最大的数据?

时间:2016-12-30 07:22:00

标签: php sql codeigniter

我有生成我的图表的代码,我想显示value_sekolah中的5个最大数据,我必须如何更改代码?

function index()
{
    if($this->processData["is_view"] == false) { show_404("forbidden access ".$this->page_name, false); }
    // generate chart
    $param['multiple']      = false;
    $param['displayTitle']  = $this->title;
    $param['displayName']   = 'nama_sekolah';
    $param['displayValue']  = 'value_sekolah';

    $this->tbl_psb_calon_siswa->str_usedFields = "asal_sekolah as nama_sekolah,count(pk_calon_siswa) as value_sekolah";
    $this->tbl_psb_calon_siswa->arrStr_groupBy = "asal_sekolah";


    $param['result']        = $this->tbl_psb_calon_siswa->selectData();

    $chart  = $this->generateChart($param);
    $arr_controller['chart_canvas'] = $chart['canvas'];
    $arr_controller['chart_js']     = $chart['chart'];

    $this->load->view("templates/grafik_template",$arr_controller);
}

0 个答案:

没有答案