KoolReport's Forum

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

Disable Gridlines #1366

Closed ankit raj opened this topic on on Apr 1, 2020 - 1 comments

ankit raj commented on Apr 1, 2020

Hello,

My settings seem to be correct but i am still unable to disable gridlines. Any idea what could be causing it?

\koolreport\chartjs\ColumnChart::create(array(
            "plugins" => [
                "datalabels"
            ],
            "title"=>"check",
            "dataSource"=>$chart_array,
            "columns"=>array(
                "category",
                "count"=>array(
                    "type"=>"number",
                    "config"=>array(
                        "backgroundColor"=>"#85A7EC",
                    )
                )
            ),

            "options"=>array(
                "legend"=>array(
                    "display"=>false
                ),

                "scales" => array(
                    "ticks"=>array(
                        "precision"=>0
                    ),
                    "yAxes" => array(
                        "scaleLabel"=>array(
                            "display"=>true,
                            "labelString"=>"Priority 1"
                        ),
                        "gridLines" => array(
                            "display" => false,
                        ),
                    )
                )
            )

        ));
KoolReport commented on Apr 1, 2020

Oh. I found the issue in your code, it should be like this:

"options"=>array(
    "scales" => array(
        "yAxes" => array(
            array( //->this is important
                "gridLines" => array(
                    "display"=>false,
                )
            ) //-> closed
        )
    )
)

Under the yAxes, you need another layer of array.

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