KoolReport's Forum

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

How to send a js function to a widget? #245

Open Robin Hodgkins opened this topic on on Apr 13, 2018 - 6 comments

Robin Hodgkins commented on Apr 13, 2018

I want to send a function to some of the properties of the ChartJs??

Tried different things but none worked :(

KoolReport commented on Apr 13, 2018

Could you please let me know the details of what function do you want to set?

Robin Hodgkins commented on Apr 13, 2018

I added a plugin called chartjs-plugin-datalabels but after that I will need to use a function for the formatter on that labels.

https://chartjs-plugin-datalabels.netlify.com/formatting.html

Robin Hodgkins commented on Apr 16, 2018

Any news?

KoolReport commented on Apr 17, 2018

Hi Robin,

If possible, please let me know what format of label do you want to set, we have applied some of the basic format for label already so I hope that it will solve your issue without using plugin.

Since we may not able to add javascript function from PHP so some of flexibility like this would be limited for now but we promise to find solution.

Regards,

KoolPHP Inc

Robin Hodgkins commented on Apr 20, 2018

numbers with . and , separators. also add the labels to the chartjs over the bars on the graph

KoolReport commented on Apr 24, 2018

Truly sorry for my late reply, if you want to set the number format, you simply do this:

"columns"=>array(
    "mycolumn"=>array(
        "type"=>"number",
        "prefix"=>"$",
        "suffix"=>"",
        "decimals"=>2
        "decimalPoint"=>".",
        "thousandSeparator"=>","
    ),
    ...
)
...

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