Skip to content

Data is missing #34

Description

@vivianyeoh

I trying to load data from sql and print on the website with koolreport. I have 5 output with this sql on phpmyadmin:
SELECT NUMOFNG, NUMOFATTEMPT, AVGTACTTIME, MODULE, RESULT FROM TTLTVNG WHERE RESULT='NG' AND MODULE='24' UNION ALL SELECT 'OK 1',SUM(NUMOFATTEMPT), AVG(AVGTACTTIME), MODULE, RESULT FROM TTLTVNG WHERE RESULT='OK' AND MODULE='24'

but the graph only print 3 of it every time.

Number of NG Total TV Average TIME(s)
1 1 30.10
3 3 6.93
OK 1 357 9.05

my code:
protected function setup()
{
$this->src('sakila_rental')
->query("SELECT NUMOFNG, NUMOFATTEMPT, AVGTACTTIME, MODULE, RESULT FROM TTLTVNG WHERE RESULT='NG' AND MODULE='24' UNION ALL SELECT 'OK 1',SUM(NUMOFATTEMPT), AVG(AVGTACTTIME), MODULE, RESULT FROM TTLTVNG WHERE RESULT='OK' AND MODULE='24'")

    ->pipe(new Group(array(
        "by"=>"NUMOFNG"
    )))
    ->pipe(new Group(array(
        "by"=>"NUMOFATTEMPT"
    )))
    ->pipe(new Group(array(
        "by"=>"AVGTACTTIME"
    )))
    ->pipe($this->dataStore('sale_by_month'));
    
     print_r(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    ),
    "cssClass"=>array(
        "table"=>"table table-hover table-bordered"
    )
));

view.php

<div style="margin-bottom:50px;">
<?php
ColumnChart::create(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    )
));
?>
</div>
<div style="margin-bottom:50px;">
<?php
    
    
    
    
Table::create(array(
    "dataSource"=>$this->dataStore('sale_by_month'),
    "columns"=>array(
        "NUMOFNG"=>array("label"=>"Number of NG", "type"=>"string"),
        "NUMOFATTEMPT"=>array("label"=>"Total TV"),
        "AVGTACTTIME"=>array("label"=>"Average TIME(s)","type"=>"number","decimals"=>2)
    ),
    "cssClass"=>array(
        "table"=>"table table-hover table-bordered"
    )
));
?>
</div>

How did this happen? What can I do to solve it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions