KoolReport's Forum

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

How to configure clustered bar/column chart in chartjs #1253

Open sajid opened this topic on on Jan 10, 2020 - 1 comments

sajid commented on Jan 10, 2020

Hello, Hi, I am trying to migrate an excel based clustered and stacked column chart. I found one example online

https://www.chartjs.org/samples/latest/charts/bar/stacked-group.html

Can someone share how to configure this in koolreport?

Regards, Sajid

pargibay commented on Jan 10, 2020

Hi,

In the examples you can get that, "stacked" option. Example

    ColumnChart::create(array(
        "title"=>"Sale Report on Stack",
        "dataSource"=>$category_sale_month,
        "columns"=>array(
            "category",
            "January"=>array("label"=>"January","type"=>"number","prefix"=>"$"),
            "February"=>array("label"=>"February","type"=>"number","prefix"=>"$"),
            "March"=>array("label"=>"March","type"=>"number","prefix"=>"$"),
        ),
        "stacked"=>true 
    ));

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

ChartJS