Skip to main content

setLocale()

Description

Applies a new locale to Pivot

Usage

setLocale(null | locale?: object): void;

Parameters

  • null - (optional) resets to the default locale (English)
  • locale - (optional) the object of data of the new locale to be applied

Example

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

// apply the "de" locale to Pivot
table.setLocale(pivot.locales.de);

// apply the default locale to Pivot
table.setLocale(); // or setLocale(null);

Related articles: