diff --git a/libs/ui/src/lib/world-map-chart/world-map-chart.component.ts b/libs/ui/src/lib/world-map-chart/world-map-chart.component.ts index f86d4d010..0d5eb7387 100644 --- a/libs/ui/src/lib/world-map-chart/world-map-chart.component.ts +++ b/libs/ui/src/lib/world-map-chart/world-map-chart.component.ts @@ -1,4 +1,8 @@ -import { getLocale, getNumberFormatGroup } from '@ghostfolio/common/helper'; +import { + getCountryName, + getLocale, + getNumberFormatGroup +} from '@ghostfolio/common/helper'; import { ChangeDetectionStrategy, @@ -25,7 +29,7 @@ export class GfWorldMapChartComponent implements OnChanges, OnDestroy { @Input() locale = getLocale(); public isLoading = true; - public svgMapElement; + public svgMapElement: any; public constructor(private changeDetectorRef: ChangeDetectorRef) {} @@ -88,6 +92,14 @@ export class GfWorldMapChartComponent implements OnChanges, OnDestroy { targetElementID: 'svgMap' }); + this.svgMapElement.options.countryNames = Object.keys( + this.svgMapElement.countries + ).reduce<{ [code: string]: string }>((names, code) => { + names[code] = getCountryName({ code, locale: this.locale }); + + return names; + }, {}); + setTimeout(() => { this.isLoading = false;