frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

feat: custom number formatter function #388

Closed ankush closed 1 year ago

ankush commented 1 year ago

You can now pass numberFormatter function in axisOptions to customize the behavior of number shortening. This is required in countries where K/M/B/T is not the standard way of shortening large numbers. E.g. India has thousands, lakh (1e5), crore (1e7).

The interface for this function is pretty simple

(value) => {
    // format value
    return value
};

Outcome

Screenshot 2022-07-14 at 8 11 41 PM