KoolReport's Forum

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

Set (min, max) Values Axis for ChartJS Charts #272

Open Alfons Parovszky opened this topic on on May 9, 2018 - 4 comments

Alfons Parovszky commented on May 9, 2018

use \koolreport\chartjs\LineChart;

 use \koolreport\chartjs\RadarChart;

I need to define the Y Axis for a LineChar and Axis for a RadarChart with a minimum and maximum value. My values in the will vary from 0 to 10 .

I hope you do have a good tip for me on this

KoolReport commented on May 9, 2018

Please do this:

LineChart::create(array(
    ...
    "options"=>array(
        "scales"=>array(
            "yAxes"=>array(
                array(
                    "ticks"=>array(
                        "suggestedMin"=>0,
                        "suggestedMax"=>10,
                    )
                )
            )
        )
    )
));
Alfons Parovszky commented on May 9, 2018

Many thanks, this is great for LineChart - worked for me when I used => 0 instead : 0

        "options"=>array("scales"=>array("Axes"=>array(
                            array("ticks"=>array(
                                "suggestedMin" => 1,
                                "suggestedMax" => 6,
                                ))))),

Any suggestions on RadarChart axis? THX a lot in advance

Alfons Parovszky commented on May 9, 2018

I did find out how to set this up for a RadarChart

               "options"=>array(
                    "scale"=>array(
                               "ticks"=>array(
                                "suggestedMin" => 1,
                                "suggestedMax" => 6,
                                "stepSize" => 1,
                                ))),

ZHX for pointing me in the right direction

KoolReport commented on May 9, 2018

That's awesome! You are expert now :)

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