KoolReport's Forum

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

ChartJS Font #1117

Open branden opened this topic on on Oct 8, 2019 - 2 comments

branden commented on Oct 8, 2019

Hi,

I would like to know how to change the color of the font. I've tried this: \koolreport\chartjs\PieChart::create(array(

                                 "title" => "By Status Delivery",
                                "dataSource" => $time_sale,
                                "columns" => array(
                                    "status",
                                    "count"
                                ),
                                "options"=>array(
                                    "legend" => array(
                                        'label' => array(
                                            "fontColor"=> "white",

                                        )
                                    )
                                )

but it doesn't seem to affect it

branden commented on Oct 8, 2019

Never mind, i found a way. Don't use 'array', rather use [ ].

if anyone needs it:

 "options"=>[                        "title"=>[
                                            "display"=>true,
                                            "text"=>"Status Delivery",
                                            "top"=>"50px",
                                            "fontFamily"=>"'Raleway', sans-serif",
                                            "fontSize"=>21,
                                            "fontColor"=>"white",
                                        ],"legend"=>[
                                            'labels' => [
                                            "display"=>true, 
                                            "fontFamily"=>"'Raleway', sans-serif",
                                            "fontSize"=>12,
                                            "fontColor"=>"white",],
],]
KoolReport commented on Oct 9, 2019

That's great! Thank you for posting your solution, definitely it will help others.

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
solved

ChartJS