Hi, I'm trying to generate google/timeline chart. When I use datastore generated from db, I have array data like below
Dump => array(3) {
[0] => array(3) {
["EVENT_TYPE"] => string(2) "BP"
["PROD_STARTTIME_DT"] => string(23) "2020-10-12 06:00:00.000"
["PROD_STOPTIME_DT"] => string(23) "2020-10-12 12:00:00.000"
}
[1] => array(3) {
["EVENT_TYPE"] => string(1) "P"
["PROD_STARTTIME_DT"] => string(23) "2020-10-12 12:00:00.000"
["PROD_STOPTIME_DT"] => string(23) "2020-10-12 17:45:00.000"
}
[2] => array(3) {
["EVENT_TYPE"] => string(1) "I"
["PROD_STARTTIME_DT"] => string(23) "2020-10-12 17:45:00.000"
["PROD_STOPTIME_DT"] => string(23) "2020-10-12 18:00:00.000"
}
}
\koolreport\widgets\google\Timeline::create(array(
"dataStore"=>$this->dataStore('PackagingLineTotal'),
"columns"=>array(
"EVENT_TYPE",
"PROD_STARTTIME_DT"=>array(
"type"=>"date",
),
"PROD_STOPTIME_DT"=>array(
"type"=>"date",
)
),
"withoutLoader"=>true
));
When I try to create chart from those data I get error "Missing value in row 0." In the documentation/example there is a structure
[
['President','Start','End'],
[ 'Gerald Ford', "1974-01-20", "1977-01-20" ],
[ 'Jimmy Carter', "1977-01-20", "1981-01-20" ],
[ 'Ronald Reagan', "1981-01-20", "1989-01-20" ],
[ 'George H. W. Bush', "1989-01-20", "1993-01-20" ],
[ 'Bill Clinton', "1993-01-20", "2001-01-20" ],
[ 'George W. Bush', "2001-01-20", "2009-01-20" ],
[ 'Barack Obama', "2009-01-20", "2017-01-20" ],
[ 'Donald Trump', "2017-01-20", date("Y-m-d") ],
],
I don't have idea how to transform my data result to the structure accepted by timeline. Maybe I do something wrong? I would be appreciate for any suggestions.