Translate the pivot table to the end-users' native language and provide them with the best reporting experience.
Play with the demo on a larger screen: save this link for later or watch the video review now.
import { Component, ViewChild } from "@angular/core";
import { FlexmonsterPivotModule, FlexmonsterPivot } from "ngx-flexmonster";
@Component({
selector: "pivot-table-demo",
templateUrl: "./pivot-table-demo.component.html",
styleUrls: ["./pivot-table-demo.component.css"],
imports: [FlexmonsterPivotModule]
})
export class PivotTableDemo {
@ViewChild("pivot") pivotRef!: FlexmonsterPivot;
protected report: Object = {
dataSource: {
type: "csv",
filename: "https://cdn.flexmonster.com/data/data-en.csv"
},
slice: {
rows: [
{
uniqueName: "Country"
},
{
uniqueName: "Category"
}
],
columns: [
{
uniqueName: "Color"
},
{
uniqueName: "[Measures]"
}
],
measures: [
{
uniqueName: "Price",
aggregation: "sum",
format: "currency"
},
{
uniqueName: "Quantity",
aggregation: "sum"
}
]
},
options: {
useCaptionsInCalculatedValueEditor: true
},
formats: [
{
name: "currency",
currencySymbol: "$",
thousandsSeparator: ",",
decimalSeparator: ".",
decimalPlaces: 2
}
]
};
pdfFonts: any = {
en: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf",
fr: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf",
it: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf",
es: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf",
pt: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf",
zh: "https://cdn.flexmonster.com/fonts/NotoSansCJKsc-Regular.ttf",
uk: "https://cdn.flexmonster.com/fonts/NotoSans-Regular.ttf"
};
currentLang = "en";
setLocalization(lang: string) {
this.currentLang = lang;
const currentReport: any = this.pivotRef.flexmonster.getReport();
currentReport.dataSource = {
type: "json",
filename: `https://cdn.flexmonster.com/data/localized/data-${lang}.json`,
mapping: `https://cdn.flexmonster.com/data/localized/data-${lang}-mapping.json`
};
currentReport.localization = `https://cdn.flexmonster.com/loc/${lang}.json`;
this.pivotRef.flexmonster.setReport(currentReport);
}
customizeToolbar(toolbar: Flexmonster.Toolbar) {
toolbar.exportHandler = (type) => {
if (type === "pdf") {
this.pivotRef.flexmonster.exportTo(type, {
fontUrl: this.pdfFonts[this.currentLang]
});
} else {
this.pivotRef.flexmonster.exportTo(type);
}
};
toolbar.showShareReportTab = true;
}
}
<button (click)="setLocalization('en')">EN</button>
<button (click)="setLocalization('fr')">FR</button>
<button (click)="setLocalization('it')">IT</button>
<button (click)="setLocalization('es')">ES</button>
<button (click)="setLocalization('pt')">PT</button>
<button (click)="setLocalization('zh')">ZH</button>
<button (click)="setLocalization('uk')">UK</button>
<fm-pivot
#pivot
[height]="550"
[toolbar]="true"
[report]="report"
(beforetoolbarcreated)="customizeToolbar($event)"
[shareReportConnection]="{ url: 'https://olap.flexmonster.com:9500' }"
>
</fm-pivot>
All text elements can be renamed or translated into the language of your choice: match labels, text messages, pop-ups, and captions to the language of your Angular reporting software.
You can quickly translate the whole component into Spanish, German, Mandarin, Thai, and other languages by simply adding one link to your code. The full list of the ready-made localizations for our Angular data grid can be found in the Localizing the component guide.
If you didn’t manage to find the required localization, you can create your own. All you need is to rewrite a JSON file with key-value pairs, where a key is the component’s element and a value is the translation of its text into the respective language.
You can also translate the entire component using global settings or override localization only for specific reports of your Angular data visualization solution.
Can't find your answer here?
Visit the FAQ page
Flexmonster Pivot Table & Charts is a JavaScript pivot table component for adding interactive reporting and data analysis to web applications. Users can summarize, filter, sort, and explore data in pivot tables and charts, drill into results, and export reports.
Flexmonster works in plain JavaScript and TypeScript projects. It also integrates with React, Next.js, Angular, Vue, Blazor, and other technologies. See all integration options.
Flexmonster supports JSON and CSV files, SQL databases, MongoDB, Elasticsearch, and Microsoft Analysis Services (SSAS). You can also connect other data sources through your own backend. See supported data sources.
Flexmonster offers licenses for internal corporate use, SaaS products, and OEM distribution. Pricing varies by license and plan. SaaS projects can also use the free SaaS Entry license during development. Learn more on the pricing page.
Yes. Flexmonster offers a 30-day free trial that lets you evaluate all its features. No credit card is required. The trial version has a watermark.
To get started with Flexmonster, follow our integration guide.