Skip to main content

locale

Description

Optional. An object of a custom locale of Pivot

Usage

locale?: object;

Default config

By default, Pivot uses the English locale. You can set it to the custom locale as well.

tip

To change the current locale dynamically, you can use the setLocale() method of Pivot

Example

const table = new pivot.Pivot("#root", {
fields,
data: dataset,
config: {
rows: ["studio", "genre"],
columns: [],
values: [
{
field: "title",
method: "count"
},
{
field: "score",
method: "max"
}
]
},

locale: pivot.locales.cn, // the "cn" locale will be set initially
// other parameters
});