KoolReport's Forum

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

Chartjs - Hide xAxis #1475

Closed Carlos Cachulo opened this topic on on Jun 5, 2020 - 1 comments

Carlos Cachulo commented on Jun 5, 2020

I'm trying to hide xAxis but it doesn't work with this code:

ColumnChart::create(array(
    "title"=>"Sale Report",
    "dataSource"=>$this->dataStore("valores"),
    "columns"=>array(
        "mes",
        "valor"=>array("label"=>"Sale","type"=>"number","prefix"=>"€"),
    ),
    "options"=>array(
        "scales"=>array(
            "xAxes"=>array(
                "display"=>"false"
            ),
       )
    )
));

What I'm doing wrong?

Carlos Cachulo commented on Jun 5, 2020

Solution

ColumnChart::create(array(
    "title"=>"Sale Report",
    "dataSource"=>$this->dataStore("valores"),
    "columns"=>array(
        "mes",
        "valor"=>array("label"=>"Sale","type"=>"number","prefix"=>"€"),
    ),
    "options"=>array(
        "scales"=>array(
            "xAxes"=>array(
                array(
                    "display"=>false
                )
            ),
        )
    )
));

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