вот мой текущий код:
MODEL:
public function isiChart()
{
$query = $this->db->query('select KODE_BRG,NAMA_BRG,COUNT(case when total=3 then 1 else null end) OOS,
COUNT(case when total >=1 and total 3 then 1 else null end) OSA from
(select b.KODE_BRG,d.NAMA_BRG,b.JUM_KARTON,b.JUM_SATUAN,b.JUM_KARTON*d.FRACT+b.JUM_SATUAN total
from assrkmd a
left join assrkmdstok b on b.TGL_RKM=a.TGL_RKM and b.KODE_MDS=a.KODE_MDS and b.KODE_CUS=a.KODE_CUS
left join asscus c on c.KODE_CUS=a.KODE_CUS
inner join asstok d on d.KODE_BRG=b.KODE_BRG
left join asssup e on e.KODE_SPL=d.KODE_SPL
left join asssgrup f on f.KODE_SGRUP=c.KODE_SGRUP
left join assgrup g on g.KODE_GRUP=f.KODE_GRUP
inner join assmds h on h.KODE_MDS=a.KODE_MDS
left join asssgrupbrg i on i.KODE_SGRUP=d.KODE_SGRUP
left join assgrupbrg j on j.KODE_GRUP=i.KODE_GRUP
inner join assgrupmds k on k.KODE_GROUP=h.KODE_GROUP
where h.TIPE_MDS =0 and a.CHECK_OUT is not null ) g
group by KODE_BRG,NAMA_BRG order by NAMA_BRG');
return $query;
КОНТРОЛЛЕР:
public function index()
{
$data['db1'] = $this->m_mds->isiChart();
$data['content'] = 'tempelates/MDS/content';
$data['chart'] = 'tempelates/MDS/chart';
$this->load->view('tempelate',$data);
}
ПРОСМОТР:
Bar graph Sessions
Highcharts.chart('container', {
chart: {type: 'bar',options3d: { enabled: true, }},
title: {text: 'All Product vs Call'},
xAxis: {
categories: [ ],
title: {text: null},
min: 0,max: 8,
scrollbar: {enabled: true},
tickLength: 0},
yAxis: {title: {text: ''}},
legend: {reversed: true},
plotOptions: {series: {stacking: 'normal'}},
credits: {enabled: true},
exporting: { enabled: true },
dataSorting: { enabled: true},
series: [{
name: 'OOS',
data: [],
color: 'rgba(54, 162, 235, 0.2)',
borderColor: 'rgba(54, 162, 235, 1)',
dataLabels: {enabled: true,
color: '#FFFFFF',
align: 'center',
format: '{point.name}{point.percentage:.1f} %',
y: 1, // 10 pixels down from the top
style: {
fontSize: '10px',
fontFamily: 'Verdana, sans-serif'
}
}
},{
name: '
Подробнее здесь: https://stackoverflow.com/questions/664 ... odeigniter