KoolReport's Forum

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

Reverse X axis after query #1403

Closed Fernando Saez opened this topic on on Apr 23, 2020 - 1 comments

Fernando Saez commented on Apr 23, 2020

Hi I created a columns chart that takes the last 12 months and get the total incomes for each month and all is fine and I ordering by date desc to get the last 12 months.

So now the problem is that the last month is first in the chart, and I want to display is in ASC by month, I cant find a way to reverse the columns after get the results

Fernando Saez commented on Apr 23, 2020

I found a solution in the view:

$data = $this->dataStore("sales")->all();
    ColumnChart::create(array(
        "dataStore"=> array_reverse($data),

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
help needed

None