KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Sort the data for the table and the chart in different ways ? #249

Open Richi Ras opened this topic on on Apr 16, 2018 - 2 comments

Richi Ras commented on Apr 16, 2018

Is it possible to sort results data in different ways on table and on a chart ? Say we have a column chart and would like to set dates on abscissae and quantity on tidy, then date axe will be "chronogic", but the corresponding table of data will be sorted for quantity

KoolReport commented on Apr 17, 2018

Definitely,

Let say you have a dataStore("abc") and want to sort differently for table and chart, you do as following:

Table::create(array(
    "dataSource"=>$this->dataStore("abc")->sort(array("quantityColumn"=>"desc"))
    ...
))

and chart

ColumnChart::create(array(
    "dataSource"=>$this->dataStore("abc")->sort(array("dateColumn"=>"desc"))
    ...
))

Hope that helps.

Richi Ras commented on Apr 17, 2018

Nice !!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None