KoolReport's Forum

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

Chartjs' format number #1841

Closed Epitello opened this topic on on Jan 12, 2021 - 3 comments

Epitello commented on Jan 12, 2021

Hello, Do you have any option to format the thousand separator of number type ? Thanks by advance

Epitello commented on Jan 12, 2021

i mean to format the number on the y axe

David Winterburn commented on Jan 14, 2021

Please try the yAxis' ticks' callback option:

    BarChart::create(array(
        ...
        "options" => array(
            array (
                'scales' => 
                array (
                  'yAxes' => 
                  array (
                    0 => 
                    array (
                      'ticks' => 
                      array (
                        'callback' => "function(label, index, labels) {
                            return ...; //format your number (label) here
                        }"
                      ),
                      'scaleLabel' => 
                      array (
                        'display' => true,
                        'labelString' => ...,
                      ),
                    ),
                  ),
                ),
              ) 
        )
    ));
Epitello commented on Jan 14, 2021

it's works fine thanks

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