KoolReport's Forum

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

Googlechart tooltip #2353

Open Epitello opened this topic on on Sep 24, 2021 - 4 comments

Epitello commented on Sep 24, 2021

Hello team, i would like to format the tooltip displayed value in columnChart (google). For exemple i'd like to do : 2580000000 / 1000 and return 2580000K in the tootltip. Do you have an option for this ? Thanks by advance

Epitello commented on Sep 24, 2021

I solved my problem using the tooltip feature. But you should add this option in the documentation

KoolReport commented on Sep 24, 2021

Thank you very much for your suggestion. Could you please share your solution?

Epitello commented on Sep 24, 2021
'tooltip' => function ($row) use($columnName, $dividerSign, $params, $format){
                    //Applique un divider si il est définie
                    $dividerRatio  = isset($params['dividerRatio']) && $params['dividerRatio'] != "" &&  $params['dividerRatio'] != 0 ? $params['dividerRatio'] : 1;
                    //Récupère le signe de division
                    $divider = isset($dividerSign[$dividerRatio]) ? $dividerSign[$dividerRatio] : "";
                    
                    return $params['columns'][$columnName]['label'].' : '.number_format($row[$columnName] / $dividerRatio, 0, $format['decimalPoint'], $format['thousandSeparator']).' '.$divider;
                };
Epitello commented on Sep 24, 2021

but this solution change the style of the tooltip (bold text and background style) and the isHTML option doesn't work. Do you know why ?

'options'=>['tooltip' => ['isHtml' => true]];

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
suggestion

None